1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix scope loading issue when the table doesn't exist

This commit is contained in:
Pratik Naik 2010-03-10 11:28:04 +00:00
parent dcd110c724
commit 181c414baa

View file

@ -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