diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 1c16d5de03..8fca34e524 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1297,6 +1297,20 @@ module ActiveRecord #:nodoc: store_full_sti_class ? name : name.demodulize end + # Merges conditions so that the result is a valid +condition+ + def merge_conditions(*conditions) + segments = [] + + conditions.each do |condition| + unless condition.blank? + sql = sanitize_sql(condition) + segments << sql unless sql.blank? + end + end + + "(#{segments.join(') AND (')})" unless segments.empty? + end + private def find_initial(options) options.update(:limit => 1) @@ -1484,20 +1498,6 @@ module ActiveRecord #:nodoc: (safe_to_array(first) + safe_to_array(second)).uniq end - # Merges conditions so that the result is a valid +condition+ - def merge_conditions(*conditions) - segments = [] - - conditions.each do |condition| - unless condition.blank? - sql = sanitize_sql(condition) - segments << sql unless sql.blank? - end - end - - "(#{segments.join(') AND (')})" unless segments.empty? - end - # Object#to_a is deprecated, though it does have the desired behavior def safe_to_array(o) case o |