improve hidden_by_expired scope

This commit is contained in:
Lisa Durand 2024-07-23 14:31:59 +02:00
parent 5c26073af7
commit ae1a6e1b3d
No known key found for this signature in database
GPG key ID: 0DF91F2CA1E8B816

View file

@ -221,7 +221,7 @@ class Dossier < ApplicationRecord
scope :prefilled, -> { where(prefilled: true) } scope :prefilled, -> { where(prefilled: true) }
scope :hidden_by_user, -> { where.not(hidden_by_user_at: nil) } 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_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_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, -> { scope :visible_by_administration, -> {
state_not_brouillon state_not_brouillon