supprime un utilisateur qui a des dossiers cachés
This commit is contained in:
parent
3f20925d66
commit
d8a51f986f
2 changed files with 26 additions and 10 deletions
|
@ -105,12 +105,11 @@ class User < ApplicationRecord
|
|||
raise "Cannot delete this user because instruction has started for some dossiers"
|
||||
end
|
||||
|
||||
if can_be_deleted?
|
||||
dossiers.each do |dossier|
|
||||
dossier.delete_and_keep_track(administration)
|
||||
end
|
||||
destroy
|
||||
dossiers.each do |dossier|
|
||||
dossier.delete_and_keep_track(administration)
|
||||
end
|
||||
dossiers.unscoped.destroy_all
|
||||
destroy
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue