scinote-web/app/models/token.rb
2017-06-23 15:19:08 +02:00

8 lines
188 B
Ruby

class Token < ApplicationRecord
validates :token, presence: true
validates :ttl, presence: true
belongs_to :user, foreign_key: 'user_id', class_name: 'User', inverse_of: :tokens
end