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

passing the quoted id to arel if the object has a quoted id

上级 13aa1e11
...@@ -24,7 +24,9 @@ def build_from_hash(attributes, default_table) ...@@ -24,7 +24,9 @@ def build_from_hash(attributes, default_table)
case value case value
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation
values = value.to_a values = value.to_a.map { |x|
x.respond_to?(:quoted_id) ? x.quoted_id : x
}
attribute.in(values) attribute.in(values)
when Range, Arel::Relation when Range, Arel::Relation
attribute.in(value) attribute.in(value)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册