app/models/foreman_tasks/task.rb in foreman-tasks-0.9.2 vs app/models/foreman_tasks/task.rb in foreman-tasks-0.9.3
- old
+ new
@@ -170,10 +170,10 @@
groups = [groups] unless groups.is_a? Array
(groups - task_groups).each { |group| task_groups << group }
end
def sub_tasks_counts
- result = %w(cancelled error pending success warning).inject({}) do |hash, state|
+ result = %w[cancelled error pending success warning].inject({}) do |hash, state|
hash.update(state => 0)
end
result.update sub_tasks.group(:result).count
sum = result.values.reduce(:+)
if respond_to?(:main_action) && main_action.respond_to?(:total_count)