diff options
Diffstat (limited to 'lib/arel/visitors/informix.rb')
-rw-r--r-- | lib/arel/visitors/informix.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/arel/visitors/informix.rb b/lib/arel/visitors/informix.rb index 984098cdf3..a578119d9b 100644 --- a/lib/arel/visitors/informix.rb +++ b/lib/arel/visitors/informix.rb @@ -2,32 +2,32 @@ module Arel module Visitors class Informix < Arel::Visitors::ToSql private - def visit_Arel_Nodes_SelectStatement o + def visit_Arel_Nodes_SelectStatement o, a [ "SELECT", - (visit(o.offset) if o.offset), - (visit(o.limit) if o.limit), - o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join, - ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), - (visit(o.lock) if o.lock), + (visit(o.offset, a) if o.offset), + (visit(o.limit, a) if o.limit), + o.cores.map { |x| visit_Arel_Nodes_SelectCore x, a }.join, + ("ORDER BY #{o.orders.map { |x| visit x, a }.join(', ')}" unless o.orders.empty?), + (visit(o.lock, a) if o.lock), ].compact.join ' ' end - def visit_Arel_Nodes_SelectCore o + def visit_Arel_Nodes_SelectCore o, a [ - "#{o.projections.map { |x| visit x }.join ', '}", - ("FROM #{visit(o.source)}" if o.source && !o.source.empty?), - ("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), + "#{o.projections.map { |x| visit x, a }.join ', '}", + ("FROM #{visit(o.source, a)}" if o.source && !o.source.empty?), + ("WHERE #{o.wheres.map { |x| visit x, a }.join ' AND ' }" unless o.wheres.empty?), + ("GROUP BY #{o.groups.map { |x| visit x, a }.join ', ' }" unless o.groups.empty?), + (visit(o.having, a) if o.having), ].compact.join ' ' end - def visit_Arel_Nodes_Offset o - "SKIP #{visit o.expr}" + def visit_Arel_Nodes_Offset o, a + "SKIP #{visit o.expr, a}" end - def visit_Arel_Nodes_Limit o - "LIMIT #{visit o.expr}" + def visit_Arel_Nodes_Limit o, a + "LIMIT #{visit o.expr, a}" end end end -end +end |