Class: Cathode::Token

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/cathode/token.rb

Overview

Defines a token model to hold the API tokens.

Instance Method Summary collapse

Instance Method Details

#expireToken

Expires the token by deactivating it and updating its ‘expired_at` field.

Returns:



10
11
12
13
# File 'app/models/cathode/token.rb', line 10

def expire
  update active: false, expired_at: Time.now
  self
end