cannot publish a procedure if no zones
This commit is contained in:
parent
bdcb451d3c
commit
272c8cae09
3 changed files with 78 additions and 5 deletions
|
@ -629,6 +629,10 @@ class Procedure < ApplicationRecord
|
|||
result << :instructeurs
|
||||
end
|
||||
|
||||
if missing_zones?
|
||||
result << :zones
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
|
@ -661,6 +665,14 @@ class Procedure < ApplicationRecord
|
|||
!AssignTo.exists?(groupe_instructeur: groupe_instructeurs)
|
||||
end
|
||||
|
||||
def missing_zones?
|
||||
if Flipper.enabled?(:zonage)
|
||||
zones.empty?
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def revised?
|
||||
feature_enabled?(:procedure_revisions) && revisions.size > 2
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue