diff options
author | jessib <jessib@riseup.net> | 2013-09-02 09:59:49 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-09-02 09:59:49 -0700 |
commit | 6110093e939db07fd27fac7c28ddcd09a49e70ed (patch) | |
tree | 4393c3e8fcb2969b0bd21800bff7dd5a1fc9c3d7 /users/app/models/token.rb | |
parent | 060e06daa065f02b811dfe12850b101a62c12c8d (diff) | |
parent | 77af7ac953fb22c181056e8c40c8749d12a63922 (diff) |
Merge pull request #74 from azul/refactor/finding-users
there's no need for User#find_by_param. clean it up
Diffstat (limited to 'users/app/models/token.rb')
-rw-r--r-- | users/app/models/token.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/users/app/models/token.rb b/users/app/models/token.rb index 514b97f..3de0059 100644 --- a/users/app/models/token.rb +++ b/users/app/models/token.rb @@ -2,14 +2,10 @@ class Token < CouchRest::Model::Base use_database :tokens - property :user_id, String, accessible: false + belongs_to :user validates :user_id, presence: true - def user - User.find(self.user_id) - end - def initialize(*args) super self.id = SecureRandom.urlsafe_base64(32).gsub(/^_*/, '') |