Sha256: 7c24b8ffe88c01e60e2e519747bb0a122df012724fbd1df3abc6d815f4826980

Contents?: true

Size: 317 Bytes

Versions: 16

Compression:

Stored size: 317 Bytes

Contents

module Landable
  class Author < ActiveRecord::Base
    include Landable::TableName
    has_many :access_tokens

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
landable-1.13.1 app/models/landable/author.rb
landable-1.12.3 app/models/landable/author.rb
landable-1.12.2 app/models/landable/author.rb
landable-1.12.1 app/models/landable/author.rb
landable-1.11.1 app/models/landable/author.rb
landable-1.11.0 app/models/landable/author.rb
landable-1.10.0.rc2 app/models/landable/author.rb
landable-1.10.0.rc1 app/models/landable/author.rb
landable-1.9.2 app/models/landable/author.rb
landable-1.9.1 app/models/landable/author.rb
landable-1.9.0 app/models/landable/author.rb
landable-1.9.0.rc2 app/models/landable/author.rb
landable-1.9.0.rc1 app/models/landable/author.rb
landable-1.8.0 app/models/landable/author.rb
landable-1.7.1.rc1 app/models/landable/author.rb
landable-1.7.0 app/models/landable/author.rb