diff options
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/join_sql.rb | 2 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/arel/visitors/join_sql.rb b/lib/arel/visitors/join_sql.rb index 099e78b692..49625e850d 100644 --- a/lib/arel/visitors/join_sql.rb +++ b/lib/arel/visitors/join_sql.rb @@ -10,7 +10,7 @@ module Arel # compatibility with Arel V1.0 class JoinSql < Arel::Visitors::ToSql def visit_Arel_Nodes_SelectCore o - o.froms.grep(Nodes::Join).map { |x| visit x }.join ', ' + [o.froms].grep(Nodes::Join).map { |x| visit x }.join ', ' end def visit_Arel_Nodes_StringJoin o diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index d3da65b425..9186d28566 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -64,7 +64,7 @@ module Arel def visit_Arel_Nodes_SelectCore o [ "SELECT #{o.projections.map { |x| visit x }.join ', '}", - ("FROM #{o.froms.map { |x| visit x }.join ', ' }" unless o.froms.empty?), + ("FROM #{visit o.froms}" if o.froms), ("WHERE #{o.wheres.map { |x| visit x }.join ' AND ' }" unless o.wheres.empty?), ("GROUP BY #{o.groups.map { |x| visit x }.join ', ' }" unless o.groups.empty?), (visit(o.having) if o.having), |