hotfix(scoping): try to avoid requesting archived: false when using termine scope, use state_termine instead

This commit is contained in:
Martin 2021-11-26 15:06:32 +01:00
parent abb7fad79a
commit cf82c030e8
3 changed files with 3 additions and 4 deletions

View file

@ -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

View file

@ -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)

View file

@ -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'),