Sha256: 7579592cad948ed594edc6003ee77ffe148d61d8bdcc4d8ae167e8f4b51ad4dc

Contents?: true

Size: 678 Bytes

Versions: 3

Compression:

Stored size: 678 Bytes

Contents

require 'doorkeeper/models/mongo_mapper/revocable'

module Doorkeeper
  class AccessGrant
    include MongoMapper::Document
    include Doorkeeper::Models::MongoMapper::Revocable
    safe
    timestamps!

    set_collection_name 'oauth_access_grants'

    key :resource_owner_id, ObjectId
    key :application_id,    ObjectId
    key :token,             String
    key :expires_in,        Integer
    key :redirect_uri,      String
    key :revoked_at,        DateTime
    key :scopes,            String

    def scopes=(value)
      write_attribute :scopes, value if value.present?
    end

    def self.create_indexes
      ensure_index :token, unique: true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
doorkeeper-1.3.1 lib/doorkeeper/models/mongo_mapper/access_grant.rb
doorkeeper-1.3.0 lib/doorkeeper/models/mongo_mapper/access_grant.rb
doorkeeper-1.2.0 lib/doorkeeper/models/mongo_mapper/access_grant.rb