Class: Doorkeeper::AccessGrant

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Models::MongoMapper::Revocable, Models::Mongoid::Revocable, Models::Mongoid::Scopes, Models::Scopes, OAuth::Helpers, MongoMapper::Document, Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/doorkeeper/models/access_grant.rb,
lib/doorkeeper/models/mongoid2/access_grant.rb,
lib/doorkeeper/models/mongoid3/access_grant.rb,
lib/doorkeeper/models/couchbase/access_grant.rb,
lib/doorkeeper/models/mongo_mapper/access_grant.rb,
lib/doorkeeper/models/active_record/access_grant.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Models::MongoMapper::Revocable

included

Methods included from Models::Mongoid::Scopes

included

Methods included from Models::Mongoid::Revocable

included

Methods included from Models::Scopes

included

Class Method Details

.authenticate(token) ⇒ Object



12
13
14
# File 'lib/doorkeeper/models/access_grant.rb', line 12

def self.authenticate(token)
  where(:token => token).first
end

.create_indexesObject



24
25
26
# File 'lib/doorkeeper/models/mongo_mapper/access_grant.rb', line 24

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

Instance Method Details

#scopes=(value) ⇒ Object



20
21
22
# File 'lib/doorkeeper/models/mongo_mapper/access_grant.rb', line 20

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