summaryrefslogtreecommitdiff
path: root/users/app/models/token.rb
blob: 3de005906812da0faa61df72042e5f33d4459867 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Token < CouchRest::Model::Base

  use_database :tokens

  belongs_to :user

  validates :user_id, presence: true

  def initialize(*args)
    super
    self.id = SecureRandom.urlsafe_base64(32).gsub(/^_*/, '')
  end

  design do
  end
end