2017-06-23 21:19:08 +08:00
|
|
|
class Token < ApplicationRecord
|
2016-11-30 23:48:42 +08:00
|
|
|
|
|
|
|
validates :token, presence: true
|
|
|
|
validates :ttl, presence: true
|
|
|
|
|
|
|
|
belongs_to :user, foreign_key: 'user_id', class_name: 'User', inverse_of: :tokens
|
|
|
|
|
2017-06-23 21:19:08 +08:00
|
|
|
end
|