mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Simplify progress calculation
This commit is contained in:
parent
1862534b2c
commit
ca7f1a3b25
1 changed files with 1 additions and 2 deletions
|
|
@ -210,8 +210,7 @@ class Event < ActiveRecord::Base
|
|||
# * +String+ -> Progress in Percent
|
||||
def calculate_progress
|
||||
result = self.progress_status
|
||||
true_items = result.select { |_key, value| value }.length
|
||||
(100 * true_items / result.length).to_s
|
||||
(100 * result.values.count(true) / result.values.count).to_s
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue