提交 e13ac306 编写于 作者: S Sean Griffin

Implement hash equality on column

The query cache uses bind values as hash keys. The current
implementation relies on reference equality for hash equality. This is
brittle, and can easily break in the future.
上级 79437642
......@@ -64,6 +64,11 @@ def ==(other)
other.sql_type == sql_type &&
other.null == null
end
alias :eql? :==
def hash
[self.class, name, default, cast_type, sql_type, null].hash
end
end
end
# :startdoc:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册