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 +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/lib/super_settings/storage/active_record_storage/models.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8062539b6606b9cd5d043cfe7ec52abfe7a49a13edb59fbd8a9660831282c89
|
4
|
+
data.tar.gz: 5bd8d1a568fc9828f0a3c1d57d2efda2109ffebf7ecbe5ba55d8ba1c01e1f57c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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-
|
11
|
+
date: 2025-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|