Class: Landable::Author

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
TableName
Defined in:
app/models/landable/author.rb

Class Method Summary collapse

Class Method Details

.authenticate!(username, token_id) ⇒ Object



6
7
8
9
10
# File 'app/models/landable/author.rb', line 6

def self.authenticate!(username, token_id)
  return unless author = where(username: username).first
  return unless author.access_tokens.fresh.exists?(token_id)
  author
end