Class: Process::Naf::DatabaseModelsCleanup

Inherits:
Application
  • Object
show all
Defined in:
app/models/process/naf/database_models_cleanup.rb

Instance Method Summary collapse

Instance Method Details

#workObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/models/process/naf/database_models_cleanup.rb', line 15

def work
  if @options_list.present?
    puts "DESCRIPTION\n\tThe following options are available:\n\n" +
      "\t--job\t\t->\tRemoves data related to jobs.\n\n" +
      "\t--runner\t->\tRemoves data related to runners. Job flag (--job) needs to be present.\n\n" +
      "\t--machine\t->\tRemoves data related to machines. Runner flag (--runner) needs to be present.\n\n" +
      "\t--all\t\t->\tRemoves data related to jobs, runners, and machines."

  elsif @all.present?
    cleanup_jobs
    cleanup_runners
    cleanup_machines

  elsif can_cleanup?
    cleanup(true)
  end
end