pg_rls 0.0.2.1 → 0.0.2.2

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: 96f6c928e78088e4781845c1243c1af8ceee143f99863af133f0aae2d40b1df8
4
- data.tar.gz: 4bb596321621511c913d8ee98a71918df75b84e3c4738ae44e9f1ee0974c74af
3
+ metadata.gz: 93c5a9cfdee90d5ae47e267bc860dd283681714f7dce61a6a91da9c039ecc007
4
+ data.tar.gz: de67343a322883ae4e428cad06dc1c2d5e6bcf1a906286e9f4237f36fbd4d742
5
5
  SHA512:
6
- metadata.gz: 6ab1085addd4d796fb221e2850459b26c0e520192916a7285fe5c7f0ddd6298cb5576f826d133f06bd9be5c2d89d0895c9446ebcc7b6c5413e0d86b9972b2721
7
- data.tar.gz: f0b744bc68654c77afeabadf2af756fe5787602b2f26262172acd6ddca51928a405b75f46f0c7824dfdfbe5c3fde0d4b03bec45c803680b37ce4a903947f06c9
6
+ metadata.gz: 87012f063d03c517ef4cd5d0580d346b4b60c0a13cb74737b3d99d8d32331a5edfee6553dfe57aacded8e5df3e0e35fcb78246d08b433239108216e781de7081
7
+ data.tar.gz: 72bee218c897bec98d2c78c8a19aba3b99b3a2ceb80c3d38249fc1b674a803f0d7bde5576fdc76419cd09d61da8e1910f368dfad35ec7583ea4aca06169cdd0a
@@ -11,11 +11,11 @@ PgRls.setup do |config|
11
11
  config.search_methods = <%= PgRls.search_methods %>
12
12
 
13
13
  ##
14
- ## Uncomment this lines if you have a custome user per enviroment
14
+ ## Uncomment this lines if you have a custome user per environment
15
15
  ## don't forget to grant the required privilange in order for it to run
16
16
  ##
17
17
  ## Remember that PgRls is adding triggers that would set the RLS to the default user
18
- ## make sure you recreate the structure.sql on each enviroment
18
+ ## make sure you recreate the structure.sql on each environment
19
19
  ##
20
20
  # config.username = Rails.application.credentials.dig(:database, :username)
21
21
  # config.password = Rails.application.credentials.dig(:database, :password)
@@ -149,10 +149,10 @@ namespace :db do
149
149
  end
150
150
  end
151
151
 
152
- namespace :enviroment do
152
+ namespace :environment do
153
153
  override_task set: :load_config do
154
154
  admin_connection do
155
- Rake::Task['db:enviroment:set:original'].invoke
155
+ Rake::Task['db:environment:set:original'].invoke
156
156
  end
157
157
  end
158
158
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRls
4
- VERSION = '0.0.2.1'
4
+ VERSION = '0.0.2.2'
5
5
  end
data/lib/pg_rls.rb CHANGED
@@ -48,7 +48,7 @@ module PgRls
48
48
  end
49
49
 
50
50
  def establish_new_connection
51
- ActiveRecord::Base.connection.disconnect!
51
+ ActiveRecord::Base.connection.disconnect! if ActiveRecord::Base.connection_pool.connected?
52
52
 
53
53
  connection_class.establish_connection(**database_configuration)
54
54
  end
@@ -101,11 +101,11 @@ module PgRls
101
101
  end
102
102
 
103
103
  def database_admin_configuration
104
- enviroment_db_configuration = database_connection_file[Rails.env]
104
+ environment_db_configuration = database_connection_file[Rails.env]
105
105
 
106
- return enviroment_db_configuration if enviroment_db_configuration['username'].present?
106
+ return environment_db_configuration if environment_db_configuration['username'].present?
107
107
 
108
- enviroment_db_configuration.first.last
108
+ environment_db_configuration.first.last
109
109
  end
110
110
 
111
111
  def database_configuration
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.0.2.1
4
+ version: 0.0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Laloush
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-29 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler