From 74caeaad157e79853b9c6804f561d3c70eea2346 Mon Sep 17 00:00:00 2001 From: Brian Cardarella Date: Sat, 22 Jan 2011 09:16:53 -0500 Subject: Added support for INTERSECT and EXCEPT --- lib/arel/visitors/to_sql.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/arel/visitors') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 7cb4213fbb..a395b7f765 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -166,6 +166,14 @@ key on UpdateManager using UpdateManager#key= "( #{visit o.left} UNION ALL #{visit o.right} )" end + def visit_Arel_Nodes_Intersect o + "( #{visit o.left} INTERSECT #{visit o.right} )" + end + + def visit_Arel_Nodes_Except o + "( #{visit o.left} EXCEPT #{visit o.right} )" + end + def visit_Arel_Nodes_Having o "HAVING #{visit o.expr}" end -- cgit v1.2.3