Module: OauthMultiDb::ActionController

Extended by:
ActiveSupport::Concern
Defined in:
lib/oauth_multi_db/action_controller.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#get_client_symbolObject



58
59
60
61
62
63
# File 'lib/oauth_multi_db/action_controller.rb', line 58

def get_client_symbol
  if client = oauth.client
    client.parse_notes
    symbol = client.client_symbol
  end
end

#oauth_db_switchObject

switch db based on incoming oauth client_id



52
53
54
55
56
# File 'lib/oauth_multi_db/action_controller.rb', line 52

def oauth_db_switch
  if client_symbol = get_client_symbol
    OauthMultiDb.config.db_switcher.call(client_symbol)
  end
end