Merge branch 'r-1902001-01' into foodcourt

This commit is contained in:
Thein Lin Kyaw
2020-07-11 04:00:55 +06:30
99 changed files with 2085 additions and 1781 deletions

View File

@@ -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