Permalink
Browse files

Remove construct_conditions

  • Loading branch information...
1 parent 6c997c3 commit 951e485b888c15fc651439686676a4e8956d0255 @lifo lifo committed Jan 15, 2010
Showing with 2 additions and 11 deletions.
  1. +2 −11 activerecord/lib/active_record/base.rb
@@ -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

0 comments on commit 951e485

Please sign in to comment.