Abstract the Procedure whitelisting

This commit is contained in:
gregoirenovel 2018-01-10 17:52:43 +01:00
parent 4f2ac6ac2e
commit 608a8eaf67
2 changed files with 5 additions and 1 deletions

View file

@ -147,6 +147,10 @@ class Procedure < ActiveRecord::Base
publiee? || archivee? publiee? || archivee?
end end
def whitelisted?
whitelisted_at.present?
end
def total_dossier def total_dossier
self.dossiers.state_not_brouillon.size self.dossiers.state_not_brouillon.size
end end

View file

@ -20,7 +20,7 @@
%header.header %header.header
%h1.header__heading= content_for(:title) %h1.header__heading= content_for(:title)
.header__actions .header__actions
- if procedure.whitelisted_at.nil? - if !procedure.whitelisted?
= link_to 'whitelister', manager_procedure_whitelist_path(procedure), method: :post, class: 'button' = link_to 'whitelister', manager_procedure_whitelist_path(procedure), method: :post, class: 'button'
%dl %dl