Sha256: 79ea11caf70f24c1222bbb195de5bf4cad2e4d623c2691e11628a6127553943f

Contents?: true

Size: 761 Bytes

Versions: 19

Compression:

Stored size: 761 Bytes

Contents

module Arel
  module Visitors
    module ArJdbcCompat

      protected

      if ToSql.instance_method('visit').arity == 1
        def do_visit(x, a); visit(x); end # a = nil
      else # > AREL 4.0
        def do_visit(x, a); visit(x, a); end
      end

      if ToSql.instance_method('visit_Arel_Nodes_SelectCore').arity == 1
        def do_visit_select_core(x, a) # a = nil
          visit_Arel_Nodes_SelectCore(x)
        end
      else # > AREL 4.0
        def do_visit_select_core(x, a)
          visit_Arel_Nodes_SelectCore(x, a)
        end
      end

      private

      def limit_for(limit_or_node)
        limit_or_node.respond_to?(:expr) ? limit_or_node.expr.to_i : limit_or_node
      end

    end
    ToSql.send(:include, ArJdbcCompat)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
activerecord-jdbc-adapter-1.3.17 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.16 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.15 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.14 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.13 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.12 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.11 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.10 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.9 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.8 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.7 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.6 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.5 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.4 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.3 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.2 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.1 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.0 lib/arel/visitors/compat.rb
activerecord-jdbc-adapter-1.3.0.rc1 lib/arel/visitors/compat.rb