Merge branch 'r-1902001-01' into foodcourt
This commit is contained in:
@@ -15,14 +15,8 @@ module MultiTenancy
|
||||
def find_tenant_by_subdomain_or_name
|
||||
if request.subdomains.last && request.subdomains.last != "www"
|
||||
set_current_tenant(Shop.find_by(subdomain: request.subdomains.last))
|
||||
elsif ENV["SERVER_MODE"] == "application"
|
||||
license = License.new(ENV["SX_PROVISION_URL"], request.host)
|
||||
shop_name = license.read_license_no_decrypt("shop_name")
|
||||
if Rails.env.production? || shop_name
|
||||
set_current_tenant(Shop.find_by(name: shop_name))
|
||||
else
|
||||
set_current_tenant(Shop.first)
|
||||
end
|
||||
elsif Shop.count == 1
|
||||
set_current_tenant(Shop.first)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user