diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-17 02:05:23 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-17 16:01:48 -0700 |
commit | e328bdaab6c1cf920af3cabc0a27e32798a9fcb6 (patch) | |
tree | c119618e50894b578fc783043117bba389e3edb2 /activerecord | |
parent | d7b3c3395fd7debc05923dba1cbea69d30899827 (diff) | |
download | rails-e328bdaab6c1cf920af3cabc0a27e32798a9fcb6.tar.gz rails-e328bdaab6c1cf920af3cabc0a27e32798a9fcb6.tar.bz2 rails-e328bdaab6c1cf920af3cabc0a27e32798a9fcb6.zip |
Make Base.merge_conditions public
Diffstat (limited to 'activerecord')
-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 |