include procedure in usual_traitement_time

This commit is contained in:
clemkeirua 2020-07-13 11:40:15 +02:00 committed by Pierre de La Morinerie (Rebase PR Action)
parent 7c3e6082ca
commit 7b9a954473

View file

@ -440,17 +440,16 @@ class Procedure < ApplicationRecord
end end
def usual_traitement_time def usual_traitement_time
# times = Traitement.includes(:dossier) times = Traitement.includes(:dossier)
# .where(state: Dossier::TERMINE) .where(dossier: self.dossiers)
# .where(processed_at: 1.month.ago..Time.zone.now) .where.not('dossiers.en_construction_at' => nil, :processed_at => nil)
# .pluck('dossiers.en_construction_at', :processed_at) .where(processed_at: 1.month.ago..Time.zone.now)
# .map { |(en_construction_at, processed_at)| processed_at - en_construction_at } .pluck('dossiers.en_construction_at', :processed_at)
.map { |(en_construction_at, processed_at)| processed_at - en_construction_at }
# if times.present? if times.present?
# times.percentile(90).ceil times.percentile(90).ceil
# end end
false
end end
def populate_champ_stable_ids def populate_champ_stable_ids