multi_client 2.2.0 → 2.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/app/models/multi_client/client.rb +6 -0
- data/lib/multi_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a6e1687c81abaeab7384d68ba3a9bc6ac3c5913
|
|
4
|
+
data.tar.gz: ce98f18cbda27d89d807825807adcf79c10f34fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d7d2adf77960c0aa426598734720488a2b2bb76c66c31f1f8f5e227e6bcc834d6411e8011359216c7796f7c74200fb5d0464ae3b18a4c9b34ca59d39ce3ee94
|
|
7
|
+
data.tar.gz: 234ee38c3ab4fff5081d8fda76a6e771a21e5cfee0e57e0c367a41406ca6805c54e307358cec24f32161b17c588419efe6a9210f2cb6bc859a03d080c0643ce6
|
|
@@ -8,6 +8,10 @@ module MultiClient
|
|
|
8
8
|
|
|
9
9
|
scope :enabled, -> { where(enabled: true) }
|
|
10
10
|
|
|
11
|
+
def self.master
|
|
12
|
+
where(identifier: Configuration.master_tenant_identifier).first
|
|
13
|
+
end
|
|
14
|
+
|
|
11
15
|
def self.current_id=(id)
|
|
12
16
|
Thread.current[:client_id] = id
|
|
13
17
|
end
|
|
@@ -36,10 +40,12 @@ module MultiClient
|
|
|
36
40
|
original_id = current_id
|
|
37
41
|
begin
|
|
38
42
|
self.current_id = tenant.id
|
|
43
|
+
Rails.logger.info "Temporarily set tenant id to #{tenant.id}"
|
|
39
44
|
block.call
|
|
40
45
|
rescue
|
|
41
46
|
raise
|
|
42
47
|
ensure
|
|
48
|
+
Rails.logger.info "Restored tenant id to #{original_id}"
|
|
43
49
|
self.current_id = original_id
|
|
44
50
|
end
|
|
45
51
|
end
|
data/lib/multi_client/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: multi_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roberto Vasquez Angel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-04-
|
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|