aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/join_sql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/visitors/join_sql.rb')
-rw-r--r--lib/arel/visitors/join_sql.rb25
1 files changed, 2 insertions, 23 deletions
diff --git a/lib/arel/visitors/join_sql.rb b/lib/arel/visitors/join_sql.rb
index d3fb18d3c6..1cdd7eb5ca 100644
--- a/lib/arel/visitors/join_sql.rb
+++ b/lib/arel/visitors/join_sql.rb
@@ -8,32 +8,11 @@ module Arel
#
# This visitor is used in SelectManager#join_sql and is for backwards
# compatibility with Arel V1.0
- class JoinSql < Arel::Visitors::ToSql
+ module JoinSql
private
def visit_Arel_Nodes_SelectCore o
- [o.froms].grep(Nodes::Join).map { |x| visit x }.join ', '
- end
-
- def visit_Arel_Nodes_StringJoin o
- [
- (visit o.left if Nodes::Join === o.left),
- visit(o.right)
- ].compact.join ' '
- end
-
- def visit_Arel_Nodes_OuterJoin o
- [
- (visit o.left if Nodes::Join === o.left),
- "LEFT OUTER JOIN #{visit o.right} #{visit o.constraint if o.constraint}"
- ].compact.join ' '
- end
-
- def visit_Arel_Nodes_InnerJoin o
- [
- (visit o.left if Nodes::Join === o.left),
- "INNER JOIN #{visit o.right} #{visit o.constraint if o.constraint}"
- ].compact.join ' '
+ o.source.right.map { |j| visit j }.join ' '
end
end
end