提交 d5902c9e 编写于 作者: S Sean Griffin

Revert deprecation of `sanitize_sql_hash_for_assignment`

This method is still used by `update_all`
上级 eb921000
* Deprecate `sanitize_sql_hash_for_conditions` and
`sanitize_sql_hash_for_assignment` without replacement. Using a `Relation`
for performing queries and updates is the prefered API.
* Deprecate `sanitize_sql_hash_for_conditions` without replacement. Using a
`Relation` for performing queries and updates is the prefered API.
*Sean Griffin*
......
......@@ -104,9 +104,6 @@ def sanitize_sql_hash_for_conditions(attrs, default_table_name = self.table_name
# { status: nil, group_id: 1 }
# # => "status = NULL , group_id = 1"
def sanitize_sql_hash_for_assignment(attrs, table)
ActiveSupport::Deprecation.warn(<<-EOWARN)
sanitize_sql_hash_for_assignment is deprecated, and will be removed in Rails 5.0
EOWARN
c = connection
attrs.map do |attr, value|
"#{c.quote_table_name_for_assignment(table, attr)} = #{quote_bound_value(value, c, columns_hash[attr.to_s])}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册