From 1c1e990d2a96b61c880ad2c04da468baadabb341 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 26 May 2021 17:30:52 +0200 Subject: [PATCH] remove useless count Co-authored-by: Christophe Robillard --- app/controllers/instructeurs/archives_controller.rb | 1 - app/views/instructeurs/archives/index.html.haml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/instructeurs/archives_controller.rb b/app/controllers/instructeurs/archives_controller.rb index fb688a5a4..097bfc106 100644 --- a/app/controllers/instructeurs/archives_controller.rb +++ b/app/controllers/instructeurs/archives_controller.rb @@ -8,7 +8,6 @@ module Instructeurs @archivable_months = archivable_months @count_dossiers_termines_by_month = Traitement.count_dossiers_termines_by_month(@procedure) @nb_dossiers = @count_dossiers_termines_by_month.sum { |count_by_month| count_by_month["count"] } - @dossiers_termines = @procedure.dossiers.state_termine @poids_total = @nb_dossiers * @average_dossier_weight groupe_instructeur = current_instructeur.groupe_instructeurs.where(procedure: @procedure.id).first @archives = Archive.for_groupe_instructeur(groupe_instructeur).to_a diff --git a/app/views/instructeurs/archives/index.html.haml b/app/views/instructeurs/archives/index.html.haml index 5db5f06e7..f7d4bbd87 100644 --- a/app/views/instructeurs/archives/index.html.haml +++ b/app/views/instructeurs/archives/index.html.haml @@ -50,7 +50,7 @@ - elsif matching_archive.try(&:pending?) %span.icon.retry = t(:archive_pending_html, created_period: time_ago_in_words(matching_archive.created_at), scope: [:instructeurs, :procedure]) - - elsif @dossiers_termines.count > 0 + - elsif @nb_dossiers > 0 = link_to instructeur_archives_path(@procedure, type: 'everything'), method: :post, class: "button" do %span.icon.new-folder Demander la création