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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed95e6005b1c1325ace3a288f25b33d5e9a64b35
4
- data.tar.gz: 9f780c279a89b8daea900809be1b648b9c9b3eb3
3
+ metadata.gz: 4a6e1687c81abaeab7384d68ba3a9bc6ac3c5913
4
+ data.tar.gz: ce98f18cbda27d89d807825807adcf79c10f34fe
5
5
  SHA512:
6
- metadata.gz: 6b2c03c72d08b4528f5bc7ae16cc9905626977ea7a72bc50491d35874d57acf92f42f37ad27edd91262b61ee54acc0482d4227ce23bdab5f317d0a1d4edd5330
7
- data.tar.gz: 7d08a4a58cec028212220ab4b4f845bec886a379acb4d9c6e0499802342524f85f7ee79cc78d2e2daa2603985acf62deb41652a471ff1fc99b0ea4c1eb3b7b81
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
@@ -1,3 +1,3 @@
1
1
  module MultiClient
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  end
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.0
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-06 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails