Permalink
Browse files

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

  • Loading branch information...
1 parent 89cc742 commit 3479c1ea6279fd4197670d2b8d2c83f19f41b412 @tenderlove tenderlove committed Sep 10, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -24,7 +24,9 @@ def build_from_hash(attributes, default_table)
case value
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)
when Range, Arel::Relation
attribute.in(value)

0 comments on commit 3479c1e

Please sign in to comment.