Skip to content

Commit

Permalink
Arel now fallback to using Arel::Attribute if the table/column doesn'…
Browse files Browse the repository at this point in the history
…t exists.

[#4142 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
miloops authored and jeremy committed Mar 10, 2010
1 parent aad432a commit e08c153
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions activerecord/lib/active_record/relation/predicate_builder.rb
Expand Up @@ -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
Expand Down

0 comments on commit e08c153

Please sign in to comment.