diff options
Diffstat (limited to 'activerecord/lib/active_record/relation/predicate_builder.rb')
-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| |