Class: ActiveRecordDataLoader::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record_data_loader/loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration, definition) ⇒ Loader

Returns a new instance of Loader.



5
6
7
8
# File 'lib/active_record_data_loader/loader.rb', line 5

def initialize(configuration, definition)
  @configuration = configuration
  @definition = definition
end

Instance Method Details

#load_dataObject



10
11
12
13
14
15
16
# File 'lib/active_record_data_loader/loader.rb', line 10

def load_data
  ActiveRecordDataLoader::ActiveRecord::PerRowValueCache.clear

  file_adapter_class.with_output_options(file_adapter_options) do |file_adapter|
    definition.models.map { |m| load_model(m, file_adapter) }
  end
end