提交 af6ec607 编写于 作者: J José Valim

No need to check if the attribute exists (this is the same behavior as in 2.3)...

No need to check if the attribute exists (this is the same behavior as in 2.3) [#4994 state:resolved] and [#5003 state:resolved]
上级 67582f08
...@@ -20,9 +20,7 @@ def build_from_hash(attributes, default_table) ...@@ -20,9 +20,7 @@ def build_from_hash(attributes, default_table)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册