diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 65e5c0495c..49bf2fefe0 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -20,7 +20,9 @@ module ActiveRecord table = Arel::Table.new(table_name, :engine => @engine) end - attribute = table[column] || Arel::Attribute.new(table, column.to_sym) + # TODO : Arel::Table#[] should fallback to using Arel::Attribute if the table/column doesn't exist + # attribute = table[column] + attribute = Arel::Attribute.new(table, column.to_sym) case value when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope