提交 86bbfbc1 编写于 作者: M Matthew Draper

Merge pull request #15676 from sgrif/sg-object-hash

Defer to super, rather than re-implementing Object#hash
......@@ -380,7 +380,11 @@ def ==(comparison_object)
# 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) ]
def hash
(id || object_id).hash
if id
id.hash
else
super
end
end
# Clone and freeze the attributes hash such that associations are still
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册