Class: ActiveRecord::MassInsert::Projection

Inherits:
Statement
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/activerecord/mass_insert/projection.rb

Overview

Handles the building of the select statement that projects the JSON array

Instance Method Summary collapse

Methods inherited from Statement

#initialize

Constructor Details

This class inherits a constructor from ActiveRecord::MassInsert::Statement

Instance Method Details

#statementObject



12
13
14
15
16
17
18
19
20
# File 'lib/activerecord/mass_insert/projection.rb', line 12

def statement
  init_args = []
  init_args << arel_table.engine if arel_table.respond_to?(:engine)

  Arel::SelectManager.new(*init_args).tap do |select_manager|
    select_manager.project(select)
    select_manager.from(table)
  end
end