From 94d2b0b62aaf69b4e7ea269d8cf63d19dc25e3ef Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 30 Jun 2011 11:53:58 -0700 Subject: [PATCH] just alias eql? to == for frewer method calls --- activerecord/lib/active_record/base.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 92f3ed161d..a900cdf49b 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1803,11 +1803,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) ]