mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 04:04:03 +00:00
replace if-else with case-when
replaced if-else with case-when slight update
This commit is contained in:
parent
93a09b729e
commit
ee3def430e
1 changed files with 6 additions and 6 deletions
|
|
@ -1,13 +1,13 @@
|
|||
module ApplicationHelper
|
||||
def target_progress_color(progress)
|
||||
progress = progress.to_i
|
||||
if progress > 90
|
||||
result = 'green'
|
||||
elsif progress < 90 && progress > 80
|
||||
result = 'orange'
|
||||
else
|
||||
result = 'red'
|
||||
result =
|
||||
case
|
||||
when progress >= 90 then 'green'
|
||||
when progress < 90 && progress >= 80 then 'orange'
|
||||
else 'red'
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue