Sha256: 13ae8cc1237ef96e6d8a9eb099a6469d37d1ce2b644edb5473d67d78d37f28d1

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 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}" if limit
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubyfb-0.5.6 lib/arel/visitors/rubyfb.rb
rubyfb-0.5.5 lib/arel/visitors/rubyfb.rb