From 169f254c79af80185b784502463b50e9c43e0a42 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Fri, 4 Jun 2021 10:38:53 +0200 Subject: [PATCH] infer champ type from class --- app/models/procedure.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 16db00fda..0af87e5a9 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -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