just alias eql? to == for frewer method calls

This commit is contained in:
Aaron Patterson
2011-06-30 11:53:58 -07:00
parent 83005cf501
commit 94d2b0b62a

View File

@@ -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) ]