pg_rls 0.1.6 → 0.1.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: d38cc4bc08fa20b5aa5e9162f36dfbdb6d8bfad6d7a368eb07af55da3c916c91
4
- data.tar.gz: 7f2f2fe18ab7b2deb4322fa962afd73a1a166f5508378f18c7cd432f0a7692e3
3
+ metadata.gz: 492256f8c775835d6ed888cc64e93bff4c0a3f9583eb9c459e1ed9a5520d7fab
4
+ data.tar.gz: f05611afd74ad000316df9622663de94d8feda84538de06cf5c548e749a60302
5
5
  SHA512:
6
- metadata.gz: 62f98f818a074ec8fcefae101469a6ec62a8ef0a7a38a35ef82bf8215df33d65e4a4692855b97434672570193da84fdb27e5899d78fd39bc60b0757339b8fa56
7
- data.tar.gz: 82b7ce76f7966a2e7ba6206d1b780b660f39853495947abb83780d7fc4a026adfaf156378e5973383c4fc893d25a96e7ededbf41139f71b9a2712312136c8fa7
6
+ metadata.gz: cabd8e2479dbf5432a26b34680932a6ff2a4b1d2f6cbd6c1c369d8f4b954a69baa4cfefe8a81f86995b07f2a966a8129d664adf9115de23c0dbb3a91623cc52a
7
+ data.tar.gz: 4f66a3686927071d5aa5f66374a63450cda26c9be6ebc86d1cf085fc373f90033e2e7d2fe50f4b1945452088122df3884ca5cd97746c43905615858cccf5fed6
data/lib/pg_rls/tenant.rb CHANGED
@@ -65,10 +65,6 @@ module PgRls
65
65
  private
66
66
 
67
67
  def switch_tenant!(resource)
68
- # rubocop: disable Rails/IgnoredColumnsAssignment
69
- PgRls.main_model.ignored_columns = []
70
- # rubocop: enable Rails/IgnoredColumnsAssignment
71
-
72
68
  tenant = find_tenant(resource)
73
69
 
74
70
  set_rls!(tenant.tenant_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRls
4
- VERSION = '0.1.6'
4
+ VERSION = '0.1.10'
5
5
  end
data/lib/pg_rls.rb CHANGED
@@ -34,6 +34,10 @@ module PgRls
34
34
  ActiveRecord::Base.ignored_columns += %w[tenant_id]
35
35
 
36
36
  yield self
37
+
38
+ Rails.application.config.to_prepare do
39
+ PgRls.main_model.ignored_columns = []
40
+ end
37
41
  end
38
42
 
39
43
  def connection_class
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Laloush
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-17 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  This gem will help you to integrate PostgreSQL RLS to help you develop a great multitenancy application
@@ -71,7 +71,7 @@ licenses:
71
71
  - MIT
72
72
  metadata:
73
73
  rubygems_mfa_required: 'true'
74
- post_install_message:
74
+ post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths:
77
77
  - lib
@@ -86,8 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.5.7
90
- signing_key:
89
+ rubygems_version: 3.5.11
90
+ signing_key:
91
91
  specification_version: 4
92
92
  summary: Write a short summary, because RubyGems requires one.
93
93
  test_files: []