scinote-web/app/models/token.rb

9 lines
220 B
Ruby
Raw Normal View History

2019-05-09 23:10:02 +08:00
# frozen_string_literal: true
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
2019-05-09 23:10:02 +08:00
belongs_to :user, foreign_key: 'user_id', class_name: 'User', inverse_of: :tokens
2017-06-23 21:19:08 +08:00
end