super_settings 2.3.0 → 2.3.1

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: e4db9231cfc6b54497dc703ad1b06b4a4a8e9773546df32786be8c60096ead77
4
- data.tar.gz: 4a7753a5e5abcdee82fcc9c5835e6164a5b5334b80d1ae6c1b59953ea013279d
3
+ metadata.gz: a8062539b6606b9cd5d043cfe7ec52abfe7a49a13edb59fbd8a9660831282c89
4
+ data.tar.gz: 5bd8d1a568fc9828f0a3c1d57d2efda2109ffebf7ecbe5ba55d8ba1c01e1f57c
5
5
  SHA512:
6
- metadata.gz: 14cddc913184e9b63f86993d6c35a1022d951c6a486bab79514c45b13eb9433959dfdb9836df09c74b5e3049b887142871955d95a9fbcdd99a7cbf8db967ea24
7
- data.tar.gz: '068ec34332ffb50af7552fac14f8ef90b2180036c7031a04ed9b51f52cfd1180f9e2b45896bb9dd00b3acdd0fb4f47d2f8fd0e9d8d06301d4cd3b1b373ce1e65'
6
+ metadata.gz: e0a64b3993479ec0f0e94ba362e9dba51dd2ca44d2da8ec09c29f2e0a67bbcae4393352846de727cd21c31eab244304edf8847d2d922acd583cc6f4dc9ebc482
7
+ data.tar.gz: 65952c3cecf4ef4c97ff4d84e0a6d49ee4515260551c6941dbe8eeaf894bf3a0d21c922ed8d6afb8431680556c39771de93656de31f1f7c8fa2ef4dd5b84f3ef
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ 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.3.1
8
+
9
+ ### Fixed
10
+
11
+ - Add check if database connection is valid for ActiveRecord storage engine to avoid race conditions where settings were not available until an application model was used.
12
+
7
13
  ## 2.3.0
8
14
 
9
15
  ### Changed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.3.1
@@ -16,8 +16,29 @@ module SuperSettings
16
16
  class << self
17
17
  # ActiveRecord storage is only available if the connection pool is connected and the table exists.
18
18
  def available?
19
+ attempt_connection!
19
20
  connection_pool&.connected? && table_exists?
20
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
+
33
+ begin
34
+ connection_pool.with_connection do
35
+ # Do nothing, just ensure that the connection is established.
36
+ end
37
+ rescue ActiveRecord::ConnectionNotEstablished
38
+ # Ignore errors so the application doesn't break if the database is not available.
39
+ # Otherwise things like build processes can fail.
40
+ end
41
+ end
21
42
  end
22
43
  end
23
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-23 00:00:00.000000000 Z
11
+ date: 2025-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler