delete adminis with procs managed by other admins

This commit is contained in:
Christophe Robillard 2020-01-08 16:08:47 +01:00 committed by clemkeirua
parent a0b4d97d08
commit 696a058280
3 changed files with 27 additions and 2 deletions

View file

@ -68,6 +68,6 @@ class Administrateur < ApplicationRecord
end
def can_be_deleted?
dossiers.state_instruction_commencee.none? && procedures.none?
dossiers.state_instruction_commencee.none? && procedures.all? { |p| p.administrateurs.count > 1 }
end
end