Permalink
Browse files

Make Base.merge_conditions public

  • Loading branch information...
1 parent d7b3c33 commit e328bdaab6c1cf920af3cabc0a27e32798a9fcb6 @jeremy jeremy committed Jun 17, 2008
Showing with 14 additions and 14 deletions.
  1. +14 −14 activerecord/lib/active_record/base.rb
@@ -1297,6 +1297,20 @@ def sti_name
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 @@ def merge_includes(first, second)
(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

0 comments on commit e328bda

Please sign in to comment.