scinote-web/app/models/token.rb
Nejc Bernot cb03ed8384 Users can now have multiple tokens
A new token is generated whenever an edit or view file is called. Tokens have a TTL of one day.
Also enabled the toggling of both wopi and wopi test mode, using environmental variables.
2016-11-30 16:48:42 +01:00

8 lines
No EOL
188 B
Ruby

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