From d910a0f5327356825450abcc8861f106e15dac21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= Date: Fri, 17 Apr 2015 09:36:02 +0200 Subject: [PATCH] Small refactoring of calculate_setup_progress --- app/models/conference.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index 9bfe8948..e2020ab3 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -707,7 +707,7 @@ class Conference < ActiveRecord::Base # ====Returns # * +Fixnum+ -> Progress in Percent def calculate_setup_progress(result) - (result.select { |_k, v| v }.length / result.length.to_f * 100).round(0).to_s + (result.values.count(true) / result.values.count.to_f * 100).round(0).to_s end ##