aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/predicate_builder.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-10 15:28:39 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-10 15:28:57 -0700
commitac9c715947430f9405a5b063be4345d814ab379b (patch)
tree188f533078ab57b7e70dd69bd8a873a1fe5e22b1 /activerecord/lib/active_record/relation/predicate_builder.rb
parent13aa1e11a0bd5d698f7d66c4cf8e9c4ee260bc36 (diff)
downloadrails-ac9c715947430f9405a5b063be4345d814ab379b.tar.gz
rails-ac9c715947430f9405a5b063be4345d814ab379b.tar.bz2
rails-ac9c715947430f9405a5b063be4345d814ab379b.zip
passing the quoted id to arel if the object has a quoted id
Diffstat (limited to 'activerecord/lib/active_record/relation/predicate_builder.rb')
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb
index 5cea2328e8..0d1307d87e 100644
--- a/activerecord/lib/active_record/relation/predicate_builder.rb
+++ b/activerecord/lib/active_record/relation/predicate_builder.rb
@@ -24,7 +24,9 @@ module ActiveRecord
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)