aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index b898a9514..bbde7d0d9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -21,8 +21,11 @@ class User < ActiveRecord::Base
self.password_confirmation ||= self.password
end
- # remove organisation and referentials if last user of it
after_destroy :check_destroy_organisation
+
+ private
+
+ # remove organisation and referentials if last user of it
def check_destroy_organisation
if organisation.users.empty?
organisation.destroy