call super rather than delegating to the other objects equal? method

This commit is contained in:
Aaron Patterson
2011-06-30 11:54:22 -07:00
parent 94d2b0b62a
commit 19f5576de3

View File

@@ -1798,7 +1798,7 @@ MSG
# Note also that destroying a record preserves its ID in the model instance, so deleted
# models are still comparable.
def ==(comparison_object)
comparison_object.equal?(self) ||
super ||
comparison_object.instance_of?(self.class) &&
id.present? &&
comparison_object.id == id