fix(exports): display exact number of dossiers count at time generation

This commit is contained in:
Colin Darie 2023-10-09 10:47:06 +02:00
parent 640f729413
commit 428b869181
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
3 changed files with 61 additions and 11 deletions

View file

@ -51,6 +51,7 @@ class Export < ApplicationRecord
end
def compute
self.dossiers_count = dossiers_for_export.count
load_snapshot!
file.attach(blob.signed_id) # attaching a blob directly might run identify/virus scanner and wipe it
@ -109,9 +110,10 @@ class Export < ApplicationRecord
end
def count
if procedure_presentation_id.present?
dossiers_for_export.count
end
return dossiers_count if !dossiers_count.nil? # export generated
return dossiers_for_export.count if procedure_presentation_id.present?
nil
end
def procedure