Commit 231a2543 authored by hugo's avatar hugo
Browse files

WIP fixing missing date records

parent 83ecea7f
......@@ -218,6 +218,8 @@ class StatisticsView < ActiveRecord::Base
def calculate_and_save!(has_active_oh)
counts = get_counts(self.date)
self.is_missing_record = counts.size == 0 ? 1 : 0
self.visitors_in = counts.sum(:visitors_in)
self.visitors_out = counts.sum(:visitors_out)
self.visitors_total = (self.visitors_in + self.visitors_out)/2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment