From 95513682039da3acff4670efea8305b3616f6c8b Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Mon, 12 Jun 2023 14:24:54 +0200 Subject: [PATCH] refactor: use persisted? instead of created_at.present? --- app/components/dossiers/message_component.rb | 2 +- app/views/administrateurs/procedures/_informations.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/dossiers/message_component.rb b/app/components/dossiers/message_component.rb index af19bc2f8..40a9c3916 100644 --- a/app/components/dossiers/message_component.rb +++ b/app/components/dossiers/message_component.rb @@ -63,6 +63,6 @@ class Dossiers::MessageComponent < ApplicationComponent end def highlight? - commentaire.created_at.present? && @messagerie_seen_at&.<(commentaire.created_at) + commentaire.persisted? && @messagerie_seen_at&.<(commentaire.created_at) end end diff --git a/app/views/administrateurs/procedures/_informations.html.haml b/app/views/administrateurs/procedures/_informations.html.haml index 39b533d04..062fc4d21 100644 --- a/app/views/administrateurs/procedures/_informations.html.haml +++ b/app/views/administrateurs/procedures/_informations.html.haml @@ -27,7 +27,7 @@ = f.number_field :duree_conservation_dossiers_dans_ds, { class: 'fr-input', placeholder: '6', required: true, max: f.object.max_duree_conservation_dossiers_dans_ds } -- if @procedure.created_at.present? +- if @procedure.persisted? = render Dsfr::InputComponent.new(form: f, attribute: :lien_site_web, input_type: :text_field, opts: {}, required: false) = render Dsfr::CalloutComponent.new(title: "Cadre juridique") do |c|