Permalink
Browse files

Arel now fallback to using Arel::Attribute if the table/column doesn'…

…t exists.

[#4142 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent aad432a commit e08c153a08a0af79b36853c0ad8bb6e916ca3e66 @miloops miloops committed with jeremy Mar 10, 2010
Showing with 1 addition and 3 deletions.
  1. +1 −3 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -20,9 +20,7 @@ def build_from_hash(attributes, default_table)
table = Arel::Table.new(table_name, :engine => @engine)
end
- # 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)
+ attribute = table[column]
case value
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope

0 comments on commit e08c153

Please sign in to comment.