diff options
author | jessib <jessib@riseup.net> | 2013-08-27 12:18:35 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-08-27 12:18:35 -0700 |
commit | dc41ae0a3fb0a137e716d8ec63084b0ec3a7299b (patch) | |
tree | c09fef161f105e7c03c35d1edcb2d257144cb97d /users/app/models/token.rb | |
parent | a87c750d1f12f15272beb117f8ee12ab711cc6d1 (diff) | |
parent | e481b8cbc05a858674a59ef36d695973622f6b3a (diff) |
Merge branch 'master' into billing_with_tests
Diffstat (limited to 'users/app/models/token.rb')
-rw-r--r-- | users/app/models/token.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/users/app/models/token.rb b/users/app/models/token.rb index cc62778..514b97f 100644 --- a/users/app/models/token.rb +++ b/users/app/models/token.rb @@ -6,6 +6,10 @@ class Token < CouchRest::Model::Base validates :user_id, presence: true + def user + User.find(self.user_id) + end + def initialize(*args) super self.id = SecureRandom.urlsafe_base64(32).gsub(/^_*/, '') |