From 8e19a5dc4c9d69adc69f52f1377c174a8d5bf751 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 30 Jun 2011 11:54:22 -0700 Subject: 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(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 57b6e64a73..c2383630e0 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1784,7 +1784,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 -- cgit v1.2.3