From 2545da6dd69067d911bbd19a7660e38dca4779dd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 30 Jun 2011 11:53:58 -0700 Subject: just alias eql? to == for frewer method calls --- activerecord/lib/active_record/base.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 5a62a29ddb..57b6e64a73 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1789,11 +1789,7 @@ MSG id.present? && comparison_object.id == id end - - # Delegates to == - def eql?(comparison_object) - self == comparison_object - end + alias :eql? :== # Delegates to id in order to allow two records of the same type and id to work with something like: # [ Person.find(1), Person.find(2), Person.find(3) ] & [ Person.find(1), Person.find(4) ] # => [ Person.find(1) ] -- cgit v1.2.3