diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-16 11:46:55 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-16 11:46:55 -0800 |
commit | ceb2f0f2169203d697acb1602348042609b3c076 (patch) | |
tree | 51e6a27abde9a74f9153e281bb276694caf31177 /activerecord | |
parent | 1dea7b5a610b663ea3910dc3a81d1fcbc1eb9120 (diff) | |
download | rails-ceb2f0f2169203d697acb1602348042609b3c076.tar.gz rails-ceb2f0f2169203d697acb1602348042609b3c076.tar.bz2 rails-ceb2f0f2169203d697acb1602348042609b3c076.zip |
use the arel table rather than generating strings
Diffstat (limited to 'activerecord')
-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 1888b4ca1d..65852cb281 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.quoted_table_name}.id"] if value.select_values.empty? + value.select_values = [value.klass.arel_table['id']] if value.select_values.empty? attribute.in(value.arel.ast) when Array, ActiveRecord::Associations::AssociationCollection values = value.to_a.map { |x| |