From 4282ab11be1b31b6e574aa2e4f3ed807991df634 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Mon, 29 Feb 2016 15:48:58 +0100 Subject: [PATCH] Exclude draft dossier on statistiques --- app/controllers/api/statistiques_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/statistiques_controller.rb b/app/controllers/api/statistiques_controller.rb index e8263aac5..b920f47c6 100644 --- a/app/controllers/api/statistiques_controller.rb +++ b/app/controllers/api/statistiques_controller.rb @@ -10,10 +10,10 @@ class API::StatistiquesController < ApplicationController private def total_dossiers - Dossier.all.size + Dossier.where.not(state: :draft).size end def dossiers_mois - Dossier.where(created_at: (1.month.ago)..Time.now).size + Dossier.where.not(state: :draft).where(created_at: (1.month.ago)..Time.now).size end end