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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e185fc243886ba4f54463e0d92727b7feaa6c33f5234adf3cbb63be1f09d33c2
4
- data.tar.gz: 05f1131baebb8aa22364f570b5cbbb6f76f944886ad6df061a85b866f2fefb6c
3
+ metadata.gz: 554a923257d7a86b4cbeb67ac23441dab40ee783f678d80f88c5e23f5d0cd2ae
4
+ data.tar.gz: 57acb3faf58450c6276bd61d8183082b5892575ea415e2f3cc0a58581ca7f756
5
5
  SHA512:
6
- metadata.gz: 555be3c212b512f4bcdacd047eb2d6e89cc3c994ace8e4444ccb4ad4e71ca5c7555b5483111a20f66ba5819035141716ca04b9941f00775dcb073e16c72b735f
7
- data.tar.gz: bd97ba31310b3b3cdeb389d317fe56b3747acebdd47de10dbd67b48a8c4476443750ff91a588c9680bc279ea03a6420f698a4f7f7487467186ef654158f12d9f
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sublease (0.2.0)
4
+ sublease (0.2.1)
5
5
  rails (>= 4.1, < 6.0)
6
6
 
7
7
  GEM
@@ -31,7 +31,9 @@ module Sublease
31
31
  end
32
32
 
33
33
  def sublease_switch_on_domain
34
- return if Sublease.current_tenant_domain == request.domain
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
- return if Sublease.current_tenant_subdomain == request.subdomain
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
- return if ((Sublease.current_tenant_subdomain == request.subdomain) && (Sublease.current_tenant_domain == request.domain))
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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sublease
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails