aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel
diff options
context:
space:
mode:
authorBrian Hahn <brian.hahn@crowdflower.com>2013-05-12 10:09:07 -0700
committerJohn Duff <duff.john@gmail.com>2014-05-18 01:27:56 +0000
commitdc2c2c3e95102124bb6157b8f66649e6546cbdda (patch)
treefafdc55c7c7ae6e5c77f29a2261857a438c2b90b /lib/arel
parent51d552c2cdcb749c2aaa96e982b5789b73f12f56 (diff)
downloadrails-dc2c2c3e95102124bb6157b8f66649e6546cbdda.tar.gz
rails-dc2c2c3e95102124bb6157b8f66649e6546cbdda.tar.bz2
rails-dc2c2c3e95102124bb6157b8f66649e6546cbdda.zip
convenience method for outer_join
Diffstat (limited to 'lib/arel')
-rw-r--r--lib/arel/select_manager.rb4
-rw-r--r--lib/arel/table.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb
index 804316209c..0bcffba680 100644
--- a/lib/arel/select_manager.rb
+++ b/lib/arel/select_manager.rb
@@ -114,6 +114,10 @@ module Arel
self
end
+ def outer_join relation
+ join(relation, Nodes::OuterJoin)
+ end
+
def having *exprs
@ctx.having = Nodes::Having.new(collapse(exprs, @ctx.having))
self
diff --git a/lib/arel/table.rb b/lib/arel/table.rb
index 16ae83c284..3866637bd2 100644
--- a/lib/arel/table.rb
+++ b/lib/arel/table.rb
@@ -64,6 +64,10 @@ primary_key (#{caller.first}) is deprecated and will be removed in Arel 4.0.0
from(self).join(relation, klass)
end
+ def outer_join relation
+ join(relation, Nodes::OuterJoin)
+ end
+
def group *columns
from(self).group(*columns)
end