diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-16 02:56:13 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-16 02:56:13 +0530 |
commit | 951e485b888c15fc651439686676a4e8956d0255 (patch) | |
tree | 9b59a2fdb52ee09ea7ebfab31b33b3ef7f69108a | |
parent | 6c997c3c39094aa5df773d0808023031507ca627 (diff) | |
download | rails-951e485b888c15fc651439686676a4e8956d0255.tar.gz rails-951e485b888c15fc651439686676a4e8956d0255.tar.bz2 rails-951e485b888c15fc651439686676a4e8956d0255.zip |
Remove construct_conditions
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 4bacf2390b..19a80a335e 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -871,10 +871,8 @@ module ActiveRecord #:nodoc: 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 @@ module ActiveRecord #:nodoc: 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 |