scinote-web/app/models/token.rb

9 lines
188 B
Ruby
Raw Normal View History

2017-06-23 21:19:08 +08:00
class Token < ApplicationRecord
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