diff options
author | Azul <azul@leap.se> | 2013-11-05 11:40:25 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-11-05 11:40:25 +0100 |
commit | b4ca13257341792f5e6496264c421af1888bcdb8 (patch) | |
tree | ce573e9b360b389ab83f21fc360e9d9434423f63 /users/app/models/account.rb | |
parent | d4f835662fac2d9dca705b5cba2e207562dec833 (diff) |
refactor: Identity.disable_all_for(user) on user destruction
This way the identity model defines how identities should be disabled. We currently still destroy them. But it will be easy and nicely isolated to change this next.
Diffstat (limited to 'users/app/models/account.rb')
-rw-r--r-- | users/app/models/account.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/users/app/models/account.rb b/users/app/models/account.rb index 5368a1b..726f642 100644 --- a/users/app/models/account.rb +++ b/users/app/models/account.rb @@ -29,9 +29,7 @@ class Account def destroy return unless @user - Identity.by_user_id.key(@user.id).each do |identity| - identity.destroy - end + Identity.disable_all_for(@user) @user.destroy end |