提交 8e8fb8a4 编写于 作者: A Aaron Patterson

just wrap as a sql literal

上级 d33dcba7
......@@ -26,8 +26,7 @@ def self.build_from_hash(engine, attributes, default_table)
when Range, Arel::Relation
attribute.in(value)
when ActiveRecord::Base
sanitized_id = attribute.class == Arel::Attributes::String ? value.id : value.quoted_id
attribute.eq(sanitized_id)
attribute.eq(Arel.sql(value.quoted_id))
when Class
# FIXME: I think we need to deprecate this behavior
attribute.eq(value.name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册