mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04: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:
@@ -20,9 +20,7 @@ module ActiveRecord
|
||||
table = Arel::Table.new(table_name, :engine => @engine)
|
||||
end
|
||||
|
||||
unless attribute = table[column]
|
||||
raise StatementInvalid, "No attribute named `#{column}` exists for table `#{table.name}`"
|
||||
end
|
||||
attribute = table[column] || Arel::Attribute.new(table, column)
|
||||
|
||||
case value
|
||||
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::Relation
|
||||
|
||||
Reference in New Issue
Block a user