From ae1a6e1b3d9197a937f688dfd355fed2fde67628 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Tue, 23 Jul 2024 14:31:59 +0200 Subject: [PATCH] improve hidden_by_expired scope --- app/models/dossier.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 969ecc2fc..6c46d3b2b 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -221,7 +221,7 @@ class Dossier < ApplicationRecord scope :prefilled, -> { where(prefilled: true) } scope :hidden_by_user, -> { where.not(hidden_by_user_at: nil) } scope :hidden_by_administration, -> { where.not(hidden_by_administration_at: nil) } - scope :hidden_by_expired, -> { where(hidden_by_reason: 'expired') } + scope :hidden_by_expired, -> { where.not(hidden_by_expired_at: nil) } scope :visible_by_user, -> { where(for_procedure_preview: false).where(hidden_by_user_at: nil, editing_fork_origin_id: nil).where(hidden_by_expired_at: nil) } scope :visible_by_administration, -> { state_not_brouillon