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 +4 -4
- data/lib/acts_as_tenant/active_job_extensions.rb +12 -1
- data/lib/acts_as_tenant/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f08b36c305d545f35106ccce014d60c77b143f697a219c0eff6fe064b797b45c
|
|
4
|
+
data.tar.gz: 95c5783b42a93e692594c7593d6e7d8dd31ca131a109a7497b6c79171419d417
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 =
|
|
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
|