diff options
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index fba17bd917..812f30c773 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1646,9 +1646,8 @@ module ActiveRecord #:nodoc: def ==(comparison_object) comparison_object.equal?(self) || (comparison_object.instance_of?(self.class) && - ((!comparison_object.new_record? && comparison_object.id == id) || - (comparison_object.new_record? && comparison_object.attributes == attributes)) - ) + comparison_object.id == id && + !comparison_object.new_record?) end # Delegates to == |