You can't compare two non-persisted objects with primary key, it will break compatibility. You can always implement new custom logic in your application or even a gem, but i can see no point in messing with == in AR.
2014/1/28 Alex Teut <[email protected]> > As described in > http://apidock.com/rails/v3.2.13/ActiveResource/Base/%3D%3D, objects are > compared by classes and ids. For one of my models I use old_entity_hash as > primary key. So I must check equality of two objects manually. I think that > using their primary key as field to compare objects is better. I've > implemented this in project and it works great. Before opening pull request > i'd better ask your opinions. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.
