diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index a5e6cfc9d..b591c3700 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -16,8 +16,8 @@ module Users before_action :store_user_location!, only: :new def index - @user_dossiers = current_user.dossiers.includes(:procedure).not_termine.order_by_updated_at.page(page) - @dossiers_traites = current_user.dossiers.includes(:procedure).termine.not_hidden_by_user.order_by_updated_at.page(page) + @user_dossiers = current_user.dossiers.includes(:procedure).state_not_termine.order_by_updated_at.page(page) + @dossiers_traites = current_user.dossiers.includes(:procedure).state_termine.not_hidden_by_user.order_by_updated_at.page(page) @dossiers_invites = current_user.dossiers_invites.includes(:procedure).order_by_updated_at.page(page) @dossiers_supprimes = current_user.deleted_dossiers.order_by_updated_at.page(page) @dossier_transfers = DossierTransfer diff --git a/app/models/dossier.rb b/app/models/dossier.rb index b4144c366..bf21c7694 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -232,7 +232,7 @@ class Dossier < ApplicationRecord scope :en_construction, -> { not_archived.state_en_construction } scope :en_instruction, -> { not_archived.state_en_instruction } scope :termine, -> { not_archived.state_termine } - scope :not_termine, -> { state_not_termine } + scope :processed_in_month, -> (month) do state_termine .joins(:traitements) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 2129ef487..4cb77fe2d 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -20,7 +20,6 @@ dossiers_path(statut: 'en-cours'), active: @statut == 'en-cours', badge: number_with_html_delimiter(@user_dossiers.count)) - - if @dossiers_traites.present? = tab_item(t('pluralize.traites', count: @dossiers_traites.count), dossiers_path(statut: 'traites'),