aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb2
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 478d2cb597..08840d102a 100644
--- a/activerecord/lib/active_record/relation/predicate_builder.rb
+++ b/activerecord/lib/active_record/relation/predicate_builder.rb
@@ -20,7 +20,7 @@ module ActiveRecord
arel_table = Arel::Table.new(table_name, @engine)
end
- attribute = Arel::Attribute.new(arel_table, column.to_sym)
+ attribute = arel_table[column] || Arel::Attribute.new(arel_table, column.to_sym)
case value
when Array, Range, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope