scinote-web/app/models/token.rb

11 lines
229 B
Ruby
Raw Normal View History

2017-06-23 21:19:08 +08:00
class Token < ApplicationRecord
2017-06-28 21:29:10 +08:00
validates :token, presence: true
validates :ttl, presence: true
2017-06-28 21:29:10 +08:00
belongs_to :user,
2017-06-28 21:40:15 +08:00
foreign_key: 'user_id',
class_name: 'User',
inverse_of: :tokens,
optional: true
2017-06-23 21:19:08 +08:00
end