From 6e15813d549fd9e56a48fd87d425fd31f37521e8 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 15 Dec 2014 16:07:30 -0800 Subject: bugfix: allow deletion of user's identities via api when user is deleted. closes #6550 --- app/models/account.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/models/account.rb') diff --git a/app/models/account.rb b/app/models/account.rb index 67fec58..d13c929 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -47,9 +47,13 @@ class Account @user.refresh_identity end - def destroy + def destroy(destroy_identity=false) return unless @user - Identity.disable_all_for(@user) + if destroy_identity == false + Identity.disable_all_for(@user) + else + Identity.destroy_all_for(@user) + end @user.destroy end -- cgit v1.2.3