Alex Teut
2014-Jan-28 14:49 UTC
Objects are compared by id, may be comparing by primary_key is more general
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 rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.