Sha256: 8003d382e5ae7fe4f4e7ee4de8101e784df5cf37073bdb8875d9effe47233774

Contents?: true

Size: 553 Bytes

Versions: 3

Compression:

Stored size: 553 Bytes

Contents

module Arel
  module Visitors
    class RubyFB < Arel::Visitors::ToSql
    	Arel::Visitors::VISITORS['rubyfb'] = Arel::Visitors::RubyFB
    private
      def visit_Arel_Nodes_SelectStatement o
      	limit = o.limit; o.limit = nil;
      	offset = o.offset; o.offset = nil;
      	limit || offset ? "SELECT #{fb_limit(limit)} #{fb_offset(offset)} * FROM (#{super})" : super
      end

      def fb_limit limit
      	"first #{limit.expr}" if limit
      end

      def fb_offset offset
      	"skip #{offset.expr}" if offset
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubyfb-0.5.9 lib/arel/visitors/rubyfb.rb
rubyfb-0.5.8 lib/arel/visitors/rubyfb.rb
rubyfb-0.5.7 lib/arel/visitors/rubyfb.rb