Module: OAuth2::Provider::Models::Mongoid

Defined in:
lib/oauth2/provider/models/mongoid.rb

Defined Under Namespace

Classes: AccessToken, Authorization, AuthorizationCode, Client

Class Method Summary collapse

Class Method Details

.activate(options = {}) ⇒ Object


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/oauth2/provider/models/mongoid.rb', line 19

def self.activate(options = {})
  OAuth2::Provider.client_class_name ||= "OAuth2::Provider::Models::Mongoid::Client"
  OAuth2::Provider.access_token_class_name ||= "OAuth2::Provider::Models::Mongoid::AccessToken"
  OAuth2::Provider.authorization_code_class_name ||= "OAuth2::Provider::Models::Mongoid::AuthorizationCode"
  OAuth2::Provider.authorization_class_name ||= "OAuth2::Provider::Models::Mongoid::Authorization"

  OAuth2::Provider.client_class.collection_name = client_collection_name
  OAuth2::Provider.access_token_class.collection_name = access_token_collection_name
  OAuth2::Provider.authorization_code_class.collection_name = authorization_code_collection_name
  OAuth2::Provider.authorization_class.collection_name = authorization_collection_name
end