fix multi_tenancy
This commit is contained in:
@@ -13,8 +13,8 @@ module MultiTenancy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def find_tenant_by_subdomain_or_name
|
def find_tenant_by_subdomain_or_name
|
||||||
if request.subdomains.last && request.subdomains.last != "www"
|
if request.subdomains.first && request.subdomains.first != "www"
|
||||||
set_current_tenant(Shop.find_by(subdomain: request.subdomains.last))
|
set_current_tenant(Shop.find_by(subdomain: request.subdomains.first))
|
||||||
elsif Shop.count == 1
|
elsif Shop.count == 1
|
||||||
set_current_tenant(Shop.first)
|
set_current_tenant(Shop.first)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user