Module: SeedDumpling::DumpMethods

Extended by:
ActiveSupport::Concern
Includes:
Enumeration
Included in:
SeedDumpling
Defined in:
lib/seed_dumpling/dump_methods.rb,
lib/seed_dumpling/dump_methods/enumeration.rb

Overview

Provides methods for dumping database records into Ruby code that can be used as seeds. Handles various data types and supports both create and import formats.

Defined Under Namespace

Modules: Enumeration

Instance Method Summary collapse

Methods included from Enumeration

#active_record_enumeration, #batch_params_from, #batch_size_from, #enumerable_enumeration

Instance Method Details

#dump(records, options = {}) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/seed_dumpling/dump_methods.rb', line 20

def dump(records, options = {})
  return nil if records.none?

  io = prepare_io(options)
  write_records(records, io, options)
ensure
  io&.close
end