提交 c7f81f14 编写于 作者: A Aaron Patterson

arel can escape the id, so avoid using the database connection

上级 83ffb82f
......@@ -26,7 +26,7 @@ def self.build_from_hash(engine, attributes, default_table)
when Range, Arel::Relation
attribute.in(value)
when ActiveRecord::Base
attribute.eq(Arel.sql(value.quoted_id))
attribute.eq(value.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.
先完成此消息的编辑!
想要评论请 注册