Sha256: 3668e1e2113d6e83f66bb299d6cab84cc7995357ad7b9f664618e229341e79e6
Contents?: true
Size: 636 Bytes
Versions: 17
Compression:
Stored size: 636 Bytes
Contents
require 'arel/visitors/compat' module Arel module Visitors class Firebird < Arel::Visitors::ToSql def visit_Arel_Nodes_SelectStatement o lim_off = [ ("FIRST #{visit(o.limit.expr)}" if o.limit), ("SKIP #{visit(o.offset.expr)}" if o.offset) ].compact.join(' ').strip sql = [ o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join, ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), ].compact.join ' ' sql.sub!(/\A(\s*SELECT\s)/i, '\&' + lim_off + ' ') unless lim_off.empty? sql end end end end
Version data entries
17 entries across 17 versions & 4 rubygems