From 51aba3978743a0b7838bedee351249b20487e870 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 9 Oct 2023 22:18:18 +0200 Subject: [PATCH] fix: simplify queries --- app/views/commencer/show.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/commencer/show.html.haml b/app/views/commencer/show.html.haml index a3dce78c8..775f4c4fc 100644 --- a/app/views/commencer/show.html.haml +++ b/app/views/commencer/show.html.haml @@ -15,9 +15,9 @@ - else - revision = @revision.draft? ? @revision : @procedure.revisions.where.not(id: @procedure.draft_revision_id) - - dossiers = current_user.dossiers.visible_by_user.where(revision: revision) - - drafts = dossiers.merge(Dossier.state_brouillon) - - not_drafts = dossiers.merge(Dossier.state_not_brouillon) + - dossiers = current_user.dossiers.visible_by_user.where(revision:) + - drafts = dossiers.brouillon + - not_drafts = dossiers.state_not_brouillon - if @prefilled_dossier = render Dsfr::CalloutComponent.new(title: t(".prefilled_draft"), heading_level: 'h2') do |c|