From 2b7a148540ccdadb4c95c2a0f1dfd4dcbbd3aab0 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 13 Jul 2017 15:18:46 +0200 Subject: [PATCH] Remove Procedure#published? --- app/models/procedure.rb | 6 +----- app/views/admin/procedures/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index e6d7213af..f60e6225b 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -94,7 +94,7 @@ class Procedure < ActiveRecord::Base end def locked? - published? + publiee? || archivee? end def clone @@ -129,10 +129,6 @@ class Procedure < ActiveRecord::Base ProcedurePath.create!(path: path, procedure: self, administrateur: self.administrateur) end - def published? - published_at.present? - end - def publiee? published_at.present? && archived_at.nil? end diff --git a/app/views/admin/procedures/show.html.haml b/app/views/admin/procedures/show.html.haml index 66d81b117..c19764e73 100644 --- a/app/views/admin/procedures/show.html.haml +++ b/app/views/admin/procedures/show.html.haml @@ -46,7 +46,7 @@ %div %h3 Lien procédure %div{ style: 'margin-left: 3%;' } - - if @facade.procedure.published? + - if @facade.procedure.publiee? || @facade.procedure.archivee? = link_to @facade.procedure.lien, @facade.procedure.lien, target: '_blank' - else %b