Merge pull request #5368 from betagouv/dev

2020-07-12-03
This commit is contained in:
Paul Chavard 2020-07-12 12:34:27 +02:00 committed by GitHub
commit 13a82d8fe9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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