Permalink
Browse files

Try using cached attribute before creating a new one

  • Loading branch information...
lifo committed Dec 31, 2009
1 parent 77c23b2 commit c62e88a5ab7bc0a70e36dceda2a0f22995a5d087
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -20,7 +20,7 @@ def build_from_hash(attributes, default_table)
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

0 comments on commit c62e88a

Please sign in to comment.