diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-30 11:53:58 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-06-30 15:31:22 -0700 |
commit | 2545da6dd69067d911bbd19a7660e38dca4779dd (patch) | |
tree | 3a29852e41a481b330c19fe07156da4d550844ab /activerecord/lib | |
parent | f7bd07b62a9372f7b370dd6959dec39e92e77dfe (diff) | |
download | rails-2545da6dd69067d911bbd19a7660e38dca4779dd.tar.gz rails-2545da6dd69067d911bbd19a7660e38dca4779dd.tar.bz2 rails-2545da6dd69067d911bbd19a7660e38dca4779dd.zip |
just alias eql? to == for frewer method calls
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 6 |
1 files changed, 1 insertions, 5 deletions
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) ] |