diff options
author | Brian Cardarella <bcardarella@gmail.com> | 2011-01-23 11:54:00 -0500 |
---|---|---|
committer | Brian Cardarella <bcardarella@gmail.com> | 2011-01-23 11:54:00 -0500 |
commit | 7b445c6dd578277f7313746fc497429a56e4b43c (patch) | |
tree | c4f41ee671d4f84996f552221bde025774880b60 /lib | |
parent | 5bc709be9eed03022927cbe8ab0708fcfa971f2b (diff) | |
download | rails-7b445c6dd578277f7313746fc497429a56e4b43c.tar.gz rails-7b445c6dd578277f7313746fc497429a56e4b43c.tar.bz2 rails-7b445c6dd578277f7313746fc497429a56e4b43c.zip |
Added MINUS for Oracle
Aliased :minus to :except for the SelectManager
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/select_manager.rb | 1 | ||||
-rw-r--r-- | lib/arel/visitors/oracle.rb | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb index 77853ea854..0fa344945e 100644 --- a/lib/arel/select_manager.rb +++ b/lib/arel/select_manager.rb @@ -152,6 +152,7 @@ module Arel def except other Nodes::Except.new ast, other.ast end + alias :minus :except def with *subqueries if subqueries.first.is_a? Symbol diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb index aaf0324fd7..3beea287a6 100644 --- a/lib/arel/visitors/oracle.rb +++ b/lib/arel/visitors/oracle.rb @@ -61,6 +61,10 @@ module Arel "raw_rnum_ > #{visit o.expr}" end + def visit_Arel_Nodes_Except o + "( #{visit o.left} MINUS #{visit o.right} )" + end + ### # Hacks for the order clauses specific to Oracle def order_hacks o |