提交 12b9920a 编写于 作者: A Aaron Patterson

removing calls to deprecated methods

上级 9f0133fb
......@@ -251,7 +251,8 @@ def update(attribute_names = @attributes.keys)
attributes_with_values = arel_attributes_values(false, false, attribute_names)
return 0 if attributes_with_values.empty?
klass = self.class
klass.unscoped.where(klass.arel_table[klass.primary_key].eq(id)).arel.update(attributes_with_values)
stmt = klass.unscoped.where(klass.arel_table[klass.primary_key].eq(id)).arel.compile_update(attributes_with_values)
klass.connection.update stmt.to_sql
end
# Creates a record with values matching those of the instance attributes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册