diff --git a/app/views/habits/_habit.html.erb b/app/views/habits/_habit.html.erb index f901db0e81..fd82f60dc7 100644 --- a/app/views/habits/_habit.html.erb +++ b/app/views/habits/_habit.html.erb @@ -1,12 +1,13 @@
<% - case habit.score - when -100..-5 then score = 'bad' - when -5..0 then score = 'iffy' - when 0..5 then score = 'ok' - when 5..15 then score = 'good' - when 15..100 then score = 'done' + s = habit.score + case + when s<-5 then score = 'bad' + when s>=-5 && s<0 then score = 'iffy' + when s>=0 && s<5 then score = 'ok' + when s>=5 && s<15 then score = 'good' + when s>=15 then score = 'done' end name = "#{habit.name}" %>