From 19f5576de34dd932fe734eec92348e40ea5a2fa4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 30 Jun 2011 11:54:22 -0700 Subject: [PATCH] call super rather than delegating to the other objects equal? method --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index a900cdf49b..a7f8e072ac 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -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