Class: ForemanPatch::Round
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ForemanPatch::Round
- Includes:
- ForemanTasks::Concerns::ActionSubject
- Defined in:
- app/models/foreman_patch/round.rb
Defined Under Namespace
Classes: Jail
Constant Summary collapse
- STATUSES =
%w(planned pending running complete).freeze
Instance Method Summary collapse
Instance Method Details
#finished? ⇒ Boolean
41 42 43 |
# File 'app/models/foreman_patch/round.rb', line 41 def finished? !(task.nil? || task.pending?) end |
#progress ⇒ Object
37 38 39 |
# File 'app/models/foreman_patch/round.rb', line 37 def progress ForemanPatch::Invocation::STATUSES.product([0]).to_h.merge(invocations.unscope(:order).group(:status).count) end |