Sha256: dd174457209f06b5776d9f89e51e4c732809ade9f6e868fcb61a5a8a59ec518c

Contents?: true

Size: 724 Bytes

Versions: 5

Compression:

Stored size: 724 Bytes

Contents

require_relative 'models/access_token_mixin'

module Doorkeeper
  class AccessToken < Sequel::Model(:oauth_access_tokens)
    include Doorkeeper::Orm::Sequel::AccessTokenMixin

    class << self
      def delete_all_for(application_id, resource_owner)
        where(application_id: application_id,
              resource_owner_id: resource_owner.id).delete
      end

      def active_for(resource_owner)
        where(resource_owner_id: resource_owner.id, revoked_at: nil)
      end

      def order_method
        :order
      end

      def created_at_desc
        ::Sequel.desc(:created_at)
      end

      def refresh_token_revoked_on_use?
        columns.include?(:previous_refresh_token)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
doorkeeper-sequel-1.4.0 lib/doorkeeper/orm/sequel/access_token.rb
doorkeeper-sequel-1.3.1 lib/doorkeeper/orm/sequel/access_token.rb
doorkeeper-sequel-1.3.0 lib/doorkeeper/orm/sequel/access_token.rb
doorkeeper-sequel-1.2.3 lib/doorkeeper/orm/sequel/access_token.rb
doorkeeper-sequel-1.2.2 lib/doorkeeper/orm/sequel/access_token.rb