Class: ActiveRecord::MassInsert::Statement

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord/mass_insert/statement.rb

Overview

Common structure for all SQL statement builders

Direct Known Subclasses

Inserter, Projection

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, payload, *matching_columns, **mapped_columns) ⇒ Statement

Returns a new instance of Statement.



9
10
11
12
13
14
# File 'lib/activerecord/mass_insert/statement.rb', line 9

def initialize(model, payload, *matching_columns, **mapped_columns)
  @model = model
  @payload = payload_to_json_array(payload)
  @matching_columns = matching_columns
  @mapped_columns = mapped_columns
end

Instance Attribute Details

#mapped_columnsObject (readonly)

Returns the value of attribute mapped_columns.



7
8
9
# File 'lib/activerecord/mass_insert/statement.rb', line 7

def mapped_columns
  @mapped_columns
end

#matching_columnsObject (readonly)

Returns the value of attribute matching_columns.



7
8
9
# File 'lib/activerecord/mass_insert/statement.rb', line 7

def matching_columns
  @matching_columns
end

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/activerecord/mass_insert/statement.rb', line 7

def model
  @model
end

#payloadObject (readonly)

Returns the value of attribute payload.



7
8
9
# File 'lib/activerecord/mass_insert/statement.rb', line 7

def payload
  @payload
end