How to test for (ActiveRecord) object equality

Rails deliberately delegates equality checks to the identity column. If you want to know if two AR objects contain the same stuff, compare the result of calling #attributes on both.

Leave a Comment