123456789_123456789_123456789_123456789_123456789_

Class: Arel::Collectors::SQLString

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, PlainString
Instance Chain:
self, PlainString
Inherits: Arel::Collectors::PlainString
Defined in: activerecord/lib/arel/collectors/sql_string.rb

Class Method Summary

PlainString - Inherited

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newSQLString

[ GitHub ]

  
# File 'activerecord/lib/arel/collectors/sql_string.rb', line 10

def initialize(*)
  super
  @bind_index = 1
end

Instance Attribute Details

#preparable (rw)

[ GitHub ]

  
# File 'activerecord/lib/arel/collectors/sql_string.rb', line 8

attr_accessor :preparable, :retryable

#retryable (rw)

[ GitHub ]

  
# File 'activerecord/lib/arel/collectors/sql_string.rb', line 8

attr_accessor :preparable, :retryable

Instance Method Details

#add_bind(bind)

[ GitHub ]

  
# File 'activerecord/lib/arel/collectors/sql_string.rb', line 15

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

#add_binds(binds, proc_for_binds = nil, &block)

[ GitHub ]

  
# File 'activerecord/lib/arel/collectors/sql_string.rb', line 21

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