Module: ActiveRecordDataLoader

Defined in:
lib/active_record_data_loader.rb,
lib/active_record_data_loader/errors.rb,
lib/active_record_data_loader/loader.rb,
lib/active_record_data_loader/version.rb,
lib/active_record_data_loader/dsl/model.rb,
lib/active_record_data_loader/data_faker.rb,
lib/active_record_data_loader/table_loader.rb,
lib/active_record_data_loader/configuration.rb,
lib/active_record_data_loader/copy_strategy.rb,
lib/active_record_data_loader/dsl/definition.rb,
lib/active_record_data_loader/active_record/list.rb,
lib/active_record_data_loader/connection_handler.rb,
lib/active_record_data_loader/file_output_adapter.rb,
lib/active_record_data_loader/null_output_adapter.rb,
lib/active_record_data_loader/bulk_insert_strategy.rb,
lib/active_record_data_loader/dsl/belongs_to_association.rb,
lib/active_record_data_loader/dsl/polymorphic_association.rb,
lib/active_record_data_loader/active_record/per_row_value_cache.rb,
lib/active_record_data_loader/active_record/column_data_provider.rb,
lib/active_record_data_loader/active_record/enum_value_generator.rb,
lib/active_record_data_loader/active_record/model_data_generator.rb,
lib/active_record_data_loader/active_record/text_value_generator.rb,
lib/active_record_data_loader/active_record/unique_index_tracker.rb,
lib/active_record_data_loader/active_record/integer_value_generator.rb,
lib/active_record_data_loader/active_record/belongs_to_data_provider.rb,
lib/active_record_data_loader/active_record/datetime_value_generator.rb,
lib/active_record_data_loader/active_record/polymorphic_belongs_to_data_provider.rb

Defined Under Namespace

Modules: ActiveRecord, Dsl Classes: BulkInsertStrategy, Configuration, ConnectionHandler, CopyStrategy, DataFaker, DuplicateKeyError, FileOutputAdapter, Loader, NullOutputAdapter, TableLoader

Constant Summary collapse

VERSION =
"1.3.1"

Class Method Summary collapse

Class Method Details

.configurationObject



43
44
45
# File 'lib/active_record_data_loader.rb', line 43

def self.configuration
  @configuration ||= ActiveRecordDataLoader::Configuration.new
end

.configure(&block) ⇒ Object



39
40
41
# File 'lib/active_record_data_loader.rb', line 39

def self.configure(&block)
  @configuration = ActiveRecordDataLoader::Configuration.new.tap { |c| block.call(c) }
end

.define(config = ActiveRecordDataLoader.configuration, &block) ⇒ Object



32
33
34
35
36
37
# File 'lib/active_record_data_loader.rb', line 32

def self.define(config = ActiveRecordDataLoader.configuration, &block)
  ActiveRecordDataLoader::Loader.new(
    config,
    ActiveRecordDataLoader::Dsl::Definition.new(config).tap { |l| l.instance_eval(&block) }
  )
end