get_progress: Move default value into else branch
This commit is contained in:
parent
db59fa096c
commit
eea7d94223
1 changed files with 2 additions and 1 deletions
|
|
@ -28,7 +28,6 @@ class Target < ActiveRecord::Base
|
||||||
# ====Returns
|
# ====Returns
|
||||||
# * +String+ -> progress in percent
|
# * +String+ -> progress in percent
|
||||||
def get_progress
|
def get_progress
|
||||||
numerator = 0
|
|
||||||
case unit
|
case unit
|
||||||
when Target.units[:submissions]
|
when Target.units[:submissions]
|
||||||
numerator = conference.events.where('created_at < ?', due_date).count
|
numerator = conference.events.where('created_at < ?', due_date).count
|
||||||
|
|
@ -36,6 +35,8 @@ class Target < ActiveRecord::Base
|
||||||
numerator = conference.registrations.where('created_at < ?', due_date).count
|
numerator = conference.registrations.where('created_at < ?', due_date).count
|
||||||
when Target.units[:program_minutes]
|
when Target.units[:program_minutes]
|
||||||
numerator = conference.current_program_minutes
|
numerator = conference.current_program_minutes
|
||||||
|
else
|
||||||
|
numerator = 0
|
||||||
end
|
end
|
||||||
(100 * numerator / target_count).to_s
|
(100 * numerator / target_count).to_s
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue