summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 4bb1e79..61793be 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -136,14 +136,27 @@ class User < CouchRest::Model::Base
Account.new(self)
end
+ # deprecated
def identity
@identity ||= Identity.for(self)
end
+ # deprecated
def refresh_identity
@identity = Identity.for(self)
end
+ def identities
+ Identity.by_user_id.key(self.id)
+ end
+
+ def destroy_identities
+ identities.each do |id|
+ id.destroy
+ end
+ end
+
+
def desired_service_level
code = self.desired_service_level_code || APP_CONFIG[:default_service_level]
ServiceLevel.new({id: code})
@@ -154,7 +167,6 @@ class User < CouchRest::Model::Base
ServiceLevel.new({id: code})
end
-
def self.send_one_month_warnings
# To determine warnings to send, need to get all users where one_month_warning_sent is not set, and where it was created greater than or equal to 1 month ago.