acts_as_tenant 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
  SHA256:
3
- metadata.gz: 0ce468857038499bb74b14492a111731539baa6a6bee4a9cecefa9a598b8d48e
4
- data.tar.gz: 89e9b45ba6df4ce362a7c17e857cd16d8c28fc10714d021e1a7bcee34811a140
3
+ metadata.gz: f08b36c305d545f35106ccce014d60c77b143f697a219c0eff6fe064b797b45c
4
+ data.tar.gz: 95c5783b42a93e692594c7593d6e7d8dd31ca131a109a7497b6c79171419d417
5
5
  SHA512:
6
- metadata.gz: 576e189176dc1099e68db52d2fa6a0c62fd8d36321b23d5b3264ea325c101a34c95c1921dae48d8d7111a0426dc305ecc586575a4486b3275e15cae24733fc4c
7
- data.tar.gz: a588f22a10de60ce2ed08d3b00e68ee07c801fa0384c8e9e238d5a024e77567f8f96c2a146290dffb38703ff5e579d96adaae5bd8b7f67f717297a87ba1901c0
6
+ metadata.gz: 25f1ba646a1f44f8071cf4bc03aab45a3464857aa0e79ddb6ae27dfbad4ec61b6241f46c86106b8bae88e45966cf120a4f82854c8e8536630d69ddf7648f41fb
7
+ data.tar.gz: 3d093c37d7bb737d57a6ec4c4e89aadbd55b23635d34aa70c6b06955933d25189378e1176de05f2d8e27e29632233c6a078c6f4c4687d7a856cba616233ab2ff
@@ -4,7 +4,7 @@ module ActsAsTenant
4
4
  # Resolve the tenant inside the perform callbacks so `rescue_from`, `retry_on`
5
5
  # and `discard_on` can handle a tenant that no longer exists.
6
6
  base.before_perform do
7
- ActsAsTenant.current_tenant = GlobalID::Locator.locate(@acts_as_tenant_global_id) if @acts_as_tenant_global_id
7
+ ActsAsTenant.current_tenant = @acts_as_tenant_job_tenant if @acts_as_tenant_global_id
8
8
  end
9
9
  end
10
10
 
@@ -26,5 +26,16 @@ module ActsAsTenant
26
26
  # and restore the thread's tenant once the job is done.
27
27
  ActsAsTenant.with_tenant(nil) { super }
28
28
  end
29
+
30
+ private
31
+
32
+ # Rails loads the arguments before the perform callbacks, so a locator that applies the
33
+ # tenant's scope needs the tenant here already.
34
+ def deserialize_arguments_if_needed
35
+ return super unless @acts_as_tenant_global_id
36
+
37
+ @acts_as_tenant_job_tenant = GlobalID::Locator.locate(@acts_as_tenant_global_id)
38
+ ActsAsTenant.with_tenant(@acts_as_tenant_job_tenant) { super }
39
+ end
29
40
  end
30
41
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsTenant
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_tenant
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
  - Erwin Matthijssen