1 require 'arel/visitors/compat'
5 class DB2 < Arel::Visitors::ToSql
6 def visit_Arel_Nodes_SelectStatement o
7 add_limit_offset([o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join,
8 ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?),
9 ].compact.join(' '), o)
12 def add_limit_offset(sql, o)
13 @connection.replace_limit_offset! sql, limit_for(o.limit), o.offset && o.offset.value