Only show the last 30 days of data in Stats

This commit is contained in:
gregoirenovel 2017-04-03 16:42:38 +02:00
parent de01914fa7
commit c4c6095abd

View file

@ -1,8 +1,8 @@
class StatsController < ApplicationController
def index
procedures = Procedure.where(:created_at => 90.days.ago..Time.now).group("date_trunc('day', created_at)").count
dossiers = Dossier.where(:created_at => 90.days.ago..Time.now).group("date_trunc('day', created_at)").count
procedures = Procedure.where(:created_at => 30.days.ago..Time.now).group("date_trunc('day', created_at)").count
dossiers = Dossier.where(:created_at => 30.days.ago..Time.now).group("date_trunc('day', created_at)").count
@procedures = clean_hash(procedures)
@dossiers = clean_hash(dossiers)