Sha256: a06c9877952655ac9ae615ee1feb1af5edb923bcd526cb1f7020b5987ebce684

Contents?: true

Size: 545 Bytes

Versions: 85

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

require "arel/collectors/plain_string"

module Arel # :nodoc: all
  module Collectors
    class SQLString < PlainString
      attr_accessor :preparable

      def initialize(*)
        super
        @bind_index = 1
      end

      def add_bind(bind)
        self << yield(@bind_index)
        @bind_index += 1
        self
      end

      def add_binds(binds, proc_for_binds = nil, &block)
        self << (@bind_index...@bind_index += binds.size).map(&block).join(", ")
        self
      end
    end
  end
end

Version data entries

85 entries across 80 versions & 8 rubygems

Version Path
activerecord-7.0.2.4 lib/arel/collectors/sql_string.rb
activerecord-6.1.5.1 lib/arel/collectors/sql_string.rb
activerecord-6.1.5 lib/arel/collectors/sql_string.rb
activerecord-7.0.2.3 lib/arel/collectors/sql_string.rb
activerecord-6.1.4.7 lib/arel/collectors/sql_string.rb
activerecord-7.0.2.2 lib/arel/collectors/sql_string.rb
activerecord-6.1.4.6 lib/arel/collectors/sql_string.rb
activerecord-6.1.4.5 lib/arel/collectors/sql_string.rb
activerecord-7.0.2.1 lib/arel/collectors/sql_string.rb
activerecord-7.0.2 lib/arel/collectors/sql_string.rb
activerecord-7.0.1 lib/arel/collectors/sql_string.rb
activerecord-7.0.0 lib/arel/collectors/sql_string.rb
activerecord-6.1.4.4 lib/arel/collectors/sql_string.rb
activerecord-7.0.0.rc3 lib/arel/collectors/sql_string.rb
activerecord-6.1.4.3 lib/arel/collectors/sql_string.rb
activerecord-6.1.4.2 lib/arel/collectors/sql_string.rb
activerecord-7.0.0.rc2 lib/arel/collectors/sql_string.rb
activerecord-7.0.0.rc1 lib/arel/collectors/sql_string.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/activerecord-6.1.4.1/lib/arel/collectors/sql_string.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/activerecord-6.1.4.1/lib/arel/collectors/sql_string.rb