sublease 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/sublease/tenant_switcher.rb +9 -3
- data/lib/sublease/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 554a923257d7a86b4cbeb67ac23441dab40ee783f678d80f88c5e23f5d0cd2ae
|
|
4
|
+
data.tar.gz: 57acb3faf58450c6276bd61d8183082b5892575ea415e2f3cc0a58581ca7f756
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7c5f32b2ec160c6660e3ab66d308b3849cbcf2e96fb2b772b4ba6c05a35feb83df52e541396ce4f1e2b9640a82e7b1d3ce07add78589cd6efb0fdd95bbcdd37
|
|
7
|
+
data.tar.gz: 47bff5acce40038dd2632de95c71fa756b8916a6c60cd174d73a8d9fa13f5b96c8016f8fbb3274611de5fa2fc9a9b352557fa5384fd2737eabe774322062e345
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
0.2.1
|
|
2
|
+
-----
|
|
3
|
+
* For speed, Sublease will not query the database for a tenant if the Sublease.current_tenant
|
|
4
|
+
is already set to the same subdomain and/or domain. This performance design doesn't work in Rails
|
|
5
|
+
test environments where the tenant's id value changes when the record is recreated in the database.
|
|
6
|
+
This speed boost is now disabled in Rails test environments forcing Sublease to find the correct
|
|
7
|
+
tenant id value.
|
|
8
|
+
|
|
1
9
|
0.2.0
|
|
2
10
|
-----
|
|
3
11
|
* Add validation of uniqueness of subdomain to domain in Sublease::Tenant.
|
data/Gemfile.lock
CHANGED
|
@@ -31,7 +31,9 @@ module Sublease
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def sublease_switch_on_domain
|
|
34
|
-
|
|
34
|
+
unless Rails.env.test?
|
|
35
|
+
return if Sublease.current_tenant_domain == request.domain
|
|
36
|
+
end
|
|
35
37
|
model = sublease_model
|
|
36
38
|
tenant = model.where(domain: request.domain).first
|
|
37
39
|
if tenant.nil?
|
|
@@ -45,7 +47,9 @@ module Sublease
|
|
|
45
47
|
end
|
|
46
48
|
|
|
47
49
|
def sublease_switch_on_subdomain
|
|
48
|
-
|
|
50
|
+
unless Rails.env.test?
|
|
51
|
+
return if Sublease.current_tenant_subdomain == request.subdomain
|
|
52
|
+
end
|
|
49
53
|
model = sublease_model
|
|
50
54
|
tenant = model.where(subdomain: request.subdomain).first
|
|
51
55
|
if tenant.nil?
|
|
@@ -59,7 +63,9 @@ module Sublease
|
|
|
59
63
|
end
|
|
60
64
|
|
|
61
65
|
def sublease_switch_on_subdomain_and_domain
|
|
62
|
-
|
|
66
|
+
unless Rails.env.test?
|
|
67
|
+
return if ((Sublease.current_tenant_subdomain == request.subdomain) && (Sublease.current_tenant_domain == request.domain))
|
|
68
|
+
end
|
|
63
69
|
model = sublease_model
|
|
64
70
|
tenant = model.where(domain: request.domain, subdomain: request.subdomain).first
|
|
65
71
|
if tenant.nil?
|
data/lib/sublease/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sublease
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- bacrossland
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-02-
|
|
11
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|