Class: Cli::ProblemsCommand

Inherits:
Thor
  • Object
show all
Defined in:
app/lib/cli/problems_command.rb

Constant Summary collapse

DESCRIPTION =
"manage problems"

Instance Method Summary collapse

Instance Method Details

#prune ⇒ Object



9
10
11
# File 'app/lib/cli/problems_command.rb', line 9

def prune
  Upgrade::PruneOrphanedProblems.perform_now
end

#purge ⇒ Object



16
17
18
19
20
21
22
# File 'app/lib/cli/problems_command.rb', line 16

def purge
  return unless ask("Are you sure you want to remove all problems", limited_to: %w[y n]) == "y"
  scope = Problem
  scope = scope.where(type: options[:type]) if options[:type]
  scope = scope.where(problematic_type: options[:class]) if options[:class]
  scope.destroy_all
end