diff options
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 545f95df2a..d8883073d0 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -470,19 +470,35 @@ module Arel collector << " " end if o.right.any? - o.right.map { |j| visit j }.join(' ') + collector = inject_join o.right, collector, ' ' end collector end + def visit_Arel_Nodes_Regexp o, collector + raise NotImplementedError, '~ not implemented for this db' + end + + def visit_Arel_Nodes_NotRegexp o, collector + raise NotImplementedError, '!~ not implemented for this db' + end + def visit_Arel_Nodes_StringJoin o visit o.left end + def visit_Arel_Nodes_FullOuterJoin o + "FULL OUTER JOIN #{visit o.left} #{visit o.right}" + end + def visit_Arel_Nodes_OuterJoin o "LEFT OUTER JOIN #{visit o.left} #{visit o.right}" end + def visit_Arel_Nodes_RightOuterJoin o + "RIGHT OUTER JOIN #{visit o.left} #{visit o.right}" + end + def visit_Arel_Nodes_InnerJoin o s = "INNER JOIN #{visit o.left}" if o.right @@ -612,7 +628,7 @@ module Arel quote(o, column_for(a)) end - def unsupported o, a + def unsupported o raise "unsupported: #{o.class.name}" end |