mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
no dividing by zero on my watch
This commit is contained in:
parent
41aa08fe7f
commit
cc2ac4cb17
@ -82,6 +82,8 @@ class BasilController < ApplicationController
|
||||
# Feedback all time
|
||||
@feedback_all_time = BasilFeedback.group(:score_adjustment).count
|
||||
days_since_start = (Date.current - BasilFeedback.minimum(:updated_at).to_date)
|
||||
days_since_start = 1 if days_since_start.zero? # no dividing by 0 lol
|
||||
|
||||
@emoji_counts_all_time = @feedback_all_time.map do |score, count|
|
||||
emoji = case score
|
||||
when -2 then "Very Bad :'("
|
||||
|
||||
Loading…
Reference in New Issue
Block a user