提交 951e485b 编写于 作者: P Pratik Naik

Remove construct_conditions

上级 6c997c3c
......@@ -871,10 +871,8 @@ def destroy(id)
def update_all(updates, conditions = nil, options = {})
relation = active_relation
if conditions = construct_conditions(conditions, nil)
relation = relation.where(Arel::SqlLiteral.new(conditions))
end
relation = relation.where(conditions) if conditions
relation = relation.where(type_condition) if finder_needs_type_condition?
relation = relation.limit(options[:limit]) if options[:limit].present?
relation = relation.order(options[:order]) if options[:order].present?
......@@ -1635,13 +1633,6 @@ def construct_offset(offset, scope)
offset
end
def construct_conditions(conditions, scope)
conditions = [conditions]
conditions << scope[:conditions] if scope
conditions << type_condition if finder_needs_type_condition?
merge_conditions(*conditions)
end
# Merges includes so that the result is a valid +include+
def merge_includes(first, second)
(Array.wrap(first) + Array.wrap(second)).uniq
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册