aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-09 15:42:29 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-09 15:42:29 -0800
commit30a0a9c23bc875eaca0c4b525696ed3ea074ba74 (patch)
tree39702e1254f93c8c207bbbe2822ab7b31990c85e /lib/arel
parent1d4cfb98954ac602c22245992c15be06feb55c08 (diff)
downloadrails-30a0a9c23bc875eaca0c4b525696ed3ea074ba74.tar.gz
rails-30a0a9c23bc875eaca0c4b525696ed3ea074ba74.tar.bz2
rails-30a0a9c23bc875eaca0c4b525696ed3ea074ba74.zip
adding a factory method for and nodes
Diffstat (limited to 'lib/arel')
-rw-r--r--lib/arel/factory_methods.rb4
-rw-r--r--lib/arel/select_manager.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/arel/factory_methods.rb b/lib/arel/factory_methods.rb
index 8fcb78069f..e45cc21170 100644
--- a/lib/arel/factory_methods.rb
+++ b/lib/arel/factory_methods.rb
@@ -9,5 +9,9 @@ module Arel
def create_string_join from, to
create_join from, to, nil, Nodes::StringJoin
end
+
+ def create_and clauses
+ Nodes::And.new clauses
+ end
end
end
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb
index 40e197910b..f8b3089a82 100644
--- a/lib/arel/select_manager.rb
+++ b/lib/arel/select_manager.rb
@@ -198,7 +198,7 @@ module Arel
def collapse exprs
return exprs.first if exprs.length == 1
- Nodes::And.new exprs.compact.map { |expr|
+ create_and exprs.compact.map { |expr|
if String === expr
Arel.sql(expr)
else