infer champ type from class

This commit is contained in:
Christophe Robillard 2021-06-04 10:38:53 +02:00
parent aee8db99d0
commit 169f254c79

View file

@ -693,7 +693,7 @@ class Procedure < ApplicationRecord
dossiers_sample = dossiers.termine.limit(100)
total_size = Champ
.includes(piece_justificative_file_attachment: :blob)
.where(type: "Champs::PieceJustificativeChamp", dossier: dossiers_sample)
.where(type: Champs::PieceJustificativeChamp.to_s, dossier: dossiers_sample)
.sum('active_storage_blobs.byte_size')
total_size / dossiers_sample.length