Merge pull request #1211 from betagouv/abstraction

Abstract the Procedure whitelisting
This commit is contained in:
LeSim 2018-01-10 18:11:41 +01:00 committed by GitHub
commit 36d8f4e056
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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