summaryrefslogtreecommitdiff
path: root/users/app/models/user.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-24 11:09:04 +0200
committerAzul <azul@leap.se>2013-07-24 11:38:32 +0200
commit370be6caa8a366774fba15d09fb03ee4d923b861 (patch)
tree48522a4750e4e3433b7670dfe158762f800d3eae /users/app/models/user.rb
parentd70c5796a2989b7b43f7e287899fb1394ae28280 (diff)
keeping the pgp_key accessors for User so views still work
Diffstat (limited to 'users/app/models/user.rb')
-rw-r--r--users/app/models/user.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/users/app/models/user.rb b/users/app/models/user.rb
index f78f290..0a89f7c 100644
--- a/users/app/models/user.rb
+++ b/users/app/models/user.rb
@@ -87,6 +87,26 @@ class User < CouchRest::Model::Base
Ticket.for_user(self).limit(count).all #defaults to having most recent updated first
end
+ # DEPRECATED
+ #
+ # Please set the key on the identity directly
+ # WARNING: This will not be serialized with the user record!
+ # It is only a workaround for the key form.
+ def public_key=(value)
+ identity.set_key(:pgp, value)
+ end
+
+ # DEPRECATED
+ #
+ # Please access identity.keys[:pgp] directly
+ def public_key
+ identity.keys[:pgp]
+ end
+
+ def identity
+ @identity ||= Identity.for(self)
+ end
+
protected
##