summaryrefslogtreecommitdiff
path: root/app/models/identity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/identity.rb')
-rw-r--r--app/models/identity.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/identity.rb b/app/models/identity.rb
index 9b97b51..ad8c01e 100644
--- a/app/models/identity.rb
+++ b/app/models/identity.rb
@@ -70,6 +70,12 @@ class Identity < CouchRest::Model::Base
end
end
+ def self.destroy_all_for(user)
+ Identity.by_user_id.key(user.id).each do |identity|
+ identity.destroy
+ end
+ end
+
def self.destroy_all_disabled
Identity.disabled.each do |identity|
identity.destroy