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

No need to check if the attribute exists (this is the same behavior as in 2.3) [#4994 state:resolved] and [#5003 state:resolved]

This commit is contained in:
José Valim 2010-06-29 20:15:29 +02:00
parent 67582f08bf
commit af6ec607fa

View file

@ -20,9 +20,7 @@ module ActiveRecord
table = Arel::Table.new(table_name, :engine => @engine) table = Arel::Table.new(table_name, :engine => @engine)
end end
unless attribute = table[column] attribute = table[column] || Arel::Attribute.new(table, column)
raise StatementInvalid, "No attribute named `#{column}` exists for table `#{table.name}`"
end
case value case value
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation