vert-core 1.0.10 → 1.0.12
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/vert/rls/consumer_context.rb +8 -1
- data/lib/vert/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: 1ae6a0dbd4ab8e8531cae0d3ac0bab155efcdc3b05d7deeebc1d8960296e0cff
|
|
4
|
+
data.tar.gz: 573c33470d90dd165f78434919fef156bc55f05e955991e624ba2aae8357ff43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 382265549bfa3ae6806f5fba101cc7ff59765c428b1cb0553f13164c2b6dbcd1d114f95f24649b4bd6213604a063eda5728c08b5e2da8998a4adfa4951f83589
|
|
7
|
+
data.tar.gz: e43a3dd92ab7900d34baff3cf7ac831d3604a0cc5c583f8fcba1ce39c6b56175afb48d26b9cd65b1294d6928eda8553eb9faaafd49e6dc7de22fe800071c7b0a
|
|
@@ -16,11 +16,18 @@ module Vert
|
|
|
16
16
|
if Vert.config.enable_rls && Vert::Current.tenant_id.present?
|
|
17
17
|
ConnectionHandler.set_context(tenant_id: Vert::Current.tenant_id, company_id: Vert::Current.company_id, user_id: Vert::Current.user_id)
|
|
18
18
|
end
|
|
19
|
-
|
|
19
|
+
work(message)
|
|
20
20
|
ensure
|
|
21
21
|
Vert::Current.reset_all
|
|
22
22
|
ConnectionHandler.reset_context if Vert.config.enable_rls
|
|
23
23
|
end
|
|
24
|
+
|
|
25
|
+
# Convenience wrapper for consumers that want to explicitly mark
|
|
26
|
+
# the RLS-protected block. Context is already set by work_with_params,
|
|
27
|
+
# so this simply yields the block.
|
|
28
|
+
def with_rls_context
|
|
29
|
+
yield
|
|
30
|
+
end
|
|
24
31
|
end
|
|
25
32
|
|
|
26
33
|
class BaseConsumer
|
data/lib/vert/version.rb
CHANGED