Module: OAuth2::Provider::Models::ActiveRecord

Defined in:
lib/oauth2/provider/models/active_record.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/active_record.rb', line 19

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

  OAuth2::Provider.client_class.table_name = client_table_name
  OAuth2::Provider.access_token_class.table_name = access_token_table_name
  OAuth2::Provider.authorization_code_class.table_name = authorization_code_table_name
  OAuth2::Provider.authorization_class.table_name = authorization_table_name
end