Skip to content

Commit

Permalink
Fix scope loading issue when the table doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Mar 10, 2010
1 parent dcd110c commit 181c414
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion activerecord/lib/active_record/relation/predicate_builder.rb
Expand Up @@ -20,7 +20,9 @@ def build_from_hash(attributes, default_table)
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
Expand Down

0 comments on commit 181c414

Please sign in to comment.