commit
13a82d8fe9
1 changed files with 10 additions and 8 deletions
|
@ -440,15 +440,17 @@ 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(state: Dossier::TERMINE)
|
||||||
.where(processed_at: 1.month.ago..Time.zone.now)
|
# .where(processed_at: 1.month.ago..Time.zone.now)
|
||||||
.pluck('dossiers.en_construction_at', :processed_at)
|
# .pluck('dossiers.en_construction_at', :processed_at)
|
||||||
.map { |(en_construction_at, processed_at)| processed_at - en_construction_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
|
||||||
|
|
Loading…
Reference in a new issue