public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Make Base.merge_conditions public
jeremy (author)
Tue Jun 17 02:05:23 -0700 2008
commit  e328bdaab6c1cf920af3cabc0a27e32798a9fcb6
tree    c119618e50894b578fc783043117bba389e3edb2
parent  d7b3c3395fd7debc05923dba1cbea69d30899827
...
1297
1298
1299
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1300
1301
1302
...
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
...
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
...
1498
1499
1500
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1501
1502
1503
0
@@ -1297,6 +1297,20 @@ module ActiveRecord #:nodoc:
0
         store_full_sti_class ? name : name.demodulize
0
       end
0
 
0
+ # Merges conditions so that the result is a valid +condition+
0
+ def merge_conditions(*conditions)
0
+ segments = []
0
+
0
+ conditions.each do |condition|
0
+ unless condition.blank?
0
+ sql = sanitize_sql(condition)
0
+ segments << sql unless sql.blank?
0
+ end
0
+ end
0
+
0
+ "(#{segments.join(') AND (')})" unless segments.empty?
0
+ end
0
+
0
       private
0
         def find_initial(options)
0
           options.update(:limit => 1)
0
@@ -1484,20 +1498,6 @@ module ActiveRecord #:nodoc:
0
          (safe_to_array(first) + safe_to_array(second)).uniq
0
         end
0
 
0
- # Merges conditions so that the result is a valid +condition+
0
- def merge_conditions(*conditions)
0
- segments = []
0
-
0
- conditions.each do |condition|
0
- unless condition.blank?
0
- sql = sanitize_sql(condition)
0
- segments << sql unless sql.blank?
0
- end
0
- end
0
-
0
- "(#{segments.join(') AND (')})" unless segments.empty?
0
- end
0
-
0
         # Object#to_a is deprecated, though it does have the desired behavior
0
         def safe_to_array(o)
0
           case o

Comments

    No one has commented yet.