Exclude draft dossier on statistiques

This commit is contained in:
Xavier J 2016-02-29 15:48:58 +01:00
parent 9c1268fdd5
commit 4282ab11be

View file

@ -10,10 +10,10 @@ class API::StatistiquesController < ApplicationController
private private
def total_dossiers def total_dossiers
Dossier.all.size Dossier.where.not(state: :draft).size
end end
def dossiers_mois 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
end end