super_settings 2.4.2 → 2.4.3

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: d80612beb95bf30870eef8bca3bed811862aa7d31a99623b82d135ea76e79f98
4
- data.tar.gz: '019850dc33568275cb36331fdb400a00c524a5dbee30422b2644ad3653ada68c'
3
+ metadata.gz: 6383a79b3768e7e5f0740c3c8d6311301376a9228ab9270f6b67b4eb7b99d886
4
+ data.tar.gz: fd6b3704596f693e41bb83a7b9face1ebfcd282ffeabc03eacf6124708bbddc7
5
5
  SHA512:
6
- metadata.gz: 1bc91ad9dd827f2da3d7e95d13533f9246d28cad89190a9f7cf2b14c6a3483d12d2f08a844ac0cd9567d5eb513074f756bcb7fc2411a8c4f85ed19bb0198bebd
7
- data.tar.gz: 9ae633a96ef5ad2fc764be7d1351917be738773254aa0ad96fa5b17bdde522e7cae600cc0a7546447a73f6575df81f512578e7b3191aef878ab09bb90df27912
6
+ metadata.gz: 8c0799047ef89481db3805e1ea017d10e1442c6328fad3ad64548734d8ff35cdab3e2691924937759949e2b87b7bd4da92976c70b225e881edc4e2d875458710
7
+ data.tar.gz: 8beaf6a047e308de38a598772e56b5827353e1b8419dfcf85d5ab86699b76b1c180a93332115acff3752f0ad5b6d7c290aed79908e8933e5c6d999912fb34294
data/CHANGELOG.md CHANGED
@@ -4,9 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 2.4.3
8
+
9
+ ### Fixed
10
+
11
+ - Model.availability? return false when the connection isn't established or there is no database.
12
+
13
+
7
14
  ## 2.4.2
8
15
 
9
- ### Fxied
16
+ ### Fixed
10
17
 
11
18
  - Model.availability? can return false when connection pool connection exists for active record storage
12
19
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.2
1
+ 2.4.3
@@ -15,28 +15,16 @@ module SuperSettings
15
15
 
16
16
  class << self
17
17
  # ActiveRecord storage is only available if the connection pool is connected and the table exists.
18
- def available?
19
- attempt_connection!
20
- connection_pool.with_connection { table_exists? }
21
- end
22
-
23
- private
24
-
25
- @connection_attempted = false
26
-
27
- def attempt_connection!
28
- return if @connection_attempted
29
-
30
- @connection_attempted = true
31
- return if connection_pool.nil? || connection_pool.connected?
32
18
 
19
+ def available?
33
20
  begin
34
- connection_pool.with_connection do
35
- # Do nothing, just ensure that the connection is established.
36
- end
37
- rescue ActiveRecord::ConnectionNotEstablished
21
+ # table_exists? will attempt to retrieve a connection from the pool and load the schema_cache
22
+ # which is memoized per connection. If there is no database or connection, it will raise an error.
23
+ table_exists?
24
+ rescue ActiveRecord::NoDatabaseError, ActiveRecord::ConnectionNotEstablished
38
25
  # Ignore errors so the application doesn't break if the database is not available.
39
26
  # Otherwise things like build processes can fail.
27
+ false
40
28
  end
41
29
  end
42
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand