license and local move to base action and update other base
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
# ActionController::Base are used by both Peatio controllers and
|
||||
# Doorkeeper controllers.
|
||||
class ActionController::Base
|
||||
|
||||
before_action :lookup_domain, :set_language
|
||||
before_action :lookup_domain, :set_locale
|
||||
|
||||
private
|
||||
|
||||
def lookup_domain
|
||||
def lookup_domain
|
||||
if request.subdomain.present? && request.subdomain != "www"
|
||||
from = request.subdomain.downcase + "." + request.domain.downcase
|
||||
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
|
||||
if (!@license.nil?)
|
||||
# logger.info "Location - " + @license.name
|
||||
logger.info "Location - " + @license.dbhost
|
||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||
# authenticate_session_token
|
||||
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
||||
|
||||
Reference in New Issue
Block a user