vert-core 1.0.8 → 1.0.10
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/connection_handler.rb +3 -3
- 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: 9311756642fb871ed72487b0330a5ac99a3d392c0b7652608b9c2a652155e49f
|
|
4
|
+
data.tar.gz: 7b6ab95b6f4047bb04e4f5442ae20fb99367ebb3b2a50c269bdd4f34cd8e9ffe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0e0ad70bbac05594457c10134f2edd1a2272b68272c98d7d7118200d4010c9e831a6d2f2effddae30c26499942dd7234c73aba449f57724b95ff849fe7059642
|
|
7
|
+
data.tar.gz: a060ef7c57e6de7ed36281fe7d0266bd1ea479ccb1db7f8cabf3cee76157706a7eb3e91c03919df14f9488c878869dc676d899295dbecf9dcc9c76cdd3f556c3
|
|
@@ -7,9 +7,9 @@ module Vert
|
|
|
7
7
|
def set_context(tenant_id:, company_id: nil, user_id: nil)
|
|
8
8
|
return unless tenant_id.present?
|
|
9
9
|
connection = ActiveRecord::Base.connection
|
|
10
|
-
connection.execute(
|
|
11
|
-
connection.execute(
|
|
12
|
-
connection.execute(
|
|
10
|
+
connection.execute("SET app.current_tenant_id = #{connection.quote(tenant_id.to_s)}")
|
|
11
|
+
connection.execute("SET app.current_company_id = #{connection.quote(company_id.to_s)}") if company_id.present?
|
|
12
|
+
connection.execute("SET app.current_user_id = #{connection.quote(user_id.to_s)}") if user_id.present?
|
|
13
13
|
Vert::Current.rls_configured = true
|
|
14
14
|
rescue StandardError => e
|
|
15
15
|
Rails.logger.error("[Vert::RLS] #{e.message}") if defined?(Rails)
|
data/lib/vert/version.rb
CHANGED