subdomain + domain

This commit is contained in:
Yan
2017-11-29 11:21:26 +06:30
parent 9bbdb22bfb
commit b1d9027d5b
2 changed files with 7 additions and 4 deletions

View File

@@ -22,9 +22,12 @@ class ApplicationController < ActionController::Base
{ locale: I18n.locale }
end
def lookup_domain
if request.subdomain.present? && request.subdomain != "www"
@license = cache_license(ENV["SX_PROVISION_URL"], request.subdomain.downcase) # request.subdomain.downcase
def lookup_domain
if request.subdomain.present? && request.subdomain != "www"
from = request.subdomain.downcase #+ "." + request.domain.downcase
puts from
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
if (!@license.nil?)
# logger.info "Location - " + @license.name
ActiveRecord::Base.establish_connection(website_connection(@license))