vert-core 1.0.8 → 1.0.9
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: 5e9ceee576cdddacc533a45290cde686730de79c57c0a20b8398cf621c0fc65c
|
|
4
|
+
data.tar.gz: 99d8f01a4d8de26934bfd1be229862e1662a75ae4676a6800c8b29fd7bcb48d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a17deed08b37000bd9be258c3c7b5218c9bf112f8f144f08199fccad3341e7b696c31c145b80966ffa50faf3bfd784330ba848f2a641fcb51ba2447cd519362
|
|
7
|
+
data.tar.gz: 881df24d6e3c2f8b50e2d3400feb771712f7a1f94f80bffe2e26444a7087dae4e008902f014921e3e4fd292e666b8ab4b6e9a5ecfe0e6a8bbdb695286ea3b90b
|
|
@@ -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 LOCAL app.current_tenant_id = #{connection.quote(tenant_id.to_s)}")
|
|
11
|
+
connection.execute("SET LOCAL app.current_company_id = #{connection.quote(company_id.to_s)}") if company_id.present?
|
|
12
|
+
connection.execute("SET LOCAL 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