diff options
author | Ernie Miller <ernie@metautonomo.us> | 2011-08-20 13:16:39 -0400 |
---|---|---|
committer | Ernie Miller <ernie@metautonomo.us> | 2011-08-20 13:16:39 -0400 |
commit | f74f5f7f00bd591fbca0cbc2b847acb0ec420256 (patch) | |
tree | 464ebbcb2c9e64ed2a7f1c874b2fbed9ea71f8fd /activerecord/lib | |
parent | e2ae015952c5bdcca044504b5be1c13a518eeaac (diff) | |
download | rails-f74f5f7f00bd591fbca0cbc2b847acb0ec420256.tar.gz rails-f74f5f7f00bd591fbca0cbc2b847acb0ec420256.tar.bz2 rails-f74f5f7f00bd591fbca0cbc2b847acb0ec420256.zip |
Fix PredicateBuilder clobbering select_values in subquery.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index dc8667b5cd..7e8ddd1b5d 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -19,7 +19,7 @@ module ActiveRecord case value when ActiveRecord::Relation - value.select_values = [value.klass.arel_table[value.klass.primary_key]] if value.select_values.empty? + value = value.select(value.klass.arel_table[value.klass.primary_key]) if value.select_values.empty? attribute.in(value.arel.ast) when Array, ActiveRecord::Associations::CollectionProxy values = value.to_a.map { |x| |