Module: ArmaFixer::Execute

Defined in:
lib/arma_fixer/execute.rb

Class Method Summary collapse

Class Method Details

.run!Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/arma_fixer/execute.rb', line 5

def run!
  ArmaFixer::MODELS_HASH.each do |model_name, columns|
    records = ArmaFixer::APP.const_get(model_name).where('')
    count = records.count
    if proceed?(model_name, count)
      show "Processing #{count} #{model_name} records. Please wait..."
      saved_record_ids = []
      process_records(records, columns, saved_record_ids)
      show "Saved #{model_name} IDs: #{saved_record_ids.sort!}"
      close_files
    else
      show "Skipped processing #{model_name} records."
      next
    end
  end
end

.show(*args) ⇒ Object



22
23
24
# File 'lib/arma_fixer/execute.rb', line 22

def show(*args)
  puts(*args)
end