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:
parent
67582f08bf
commit
af6ec607fa
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue