feat: US4.3 update and delete groupe gestionnaire

This commit is contained in:
seb-by-ouidou 2023-09-30 10:45:54 +00:00 committed by seb-by-ouidou
parent 043ffef79a
commit 96dd6bec52
2 changed files with 88 additions and 0 deletions

View file

@ -26,4 +26,8 @@ class GroupeGestionnaire < ApplicationRecord
def parent_name
parent&.name
end
def can_be_deleted?(current_user)
(gestionnaires.empty? || (gestionnaires == [current_user]))&& administrateurs.empty? && children.empty?
end
end