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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6511e0828487854e75a90388687b0432d9e2c2f3c7f480a9c94546866910c045
4
- data.tar.gz: d56de4d337f77160a65e4b3993a36203656952a0db5a26eae380e804cddf22bd
3
+ metadata.gz: 9311756642fb871ed72487b0330a5ac99a3d392c0b7652608b9c2a652155e49f
4
+ data.tar.gz: 7b6ab95b6f4047bb04e4f5442ae20fb99367ebb3b2a50c269bdd4f34cd8e9ffe
5
5
  SHA512:
6
- metadata.gz: 6ca56ea97dbd0f81e207f71e80496c6a99da19093c7f2073f19576ee751cdf5d76f17429bba7b534bc7b0aa1a8c68872194080fef2fbeed8bd505af9b97eb12e
7
- data.tar.gz: 177b6ce59ce094c8927c7cfa0a2aed060f82b6f14f61c066e7eb072f919634e63d704bbd6e2a7700ee371202cb29396fd55faf8cca21e820bd6f7b9cd43e032a
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(ActiveRecord::Base.sanitize_sql(["SET LOCAL app.current_tenant_id = %s", tenant_id]))
11
- connection.execute(ActiveRecord::Base.sanitize_sql(["SET LOCAL app.current_company_id = %s", company_id])) if company_id.present?
12
- connection.execute(ActiveRecord::Base.sanitize_sql(["SET LOCAL app.current_user_id = %s", user_id])) if user_id.present?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vert
4
- VERSION = "1.0.8"
4
+ VERSION = "1.0.10"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vert Team