Module: SeedOMatic::Runner

Extended by:
Runner
Included in:
SeedOMatic, Runner
Defined in:
lib/seedomatic/runner.rb

Instance Method Summary collapse

Instance Method Details

#run(opts = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/seedomatic/runner.rb', line 7

def run (opts = {})
  results = {}

  files_to_import(opts).each do |file|
    file_info = load_file(file)

    file_info.each do |f|
      if should_import?(opts, f)
        results[f[:model_name]] = Seeder.new(f).import
      end
    end
  end

  results
end