glib-web 6.9.1 → 6.9.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 +4 -4
- data/lib/glib/engine.rb +10 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b14f64597fd648c2aee68f4e201e47e1cbe5b8c5e6b57da72a8334a7adeaba91
|
|
4
|
+
data.tar.gz: 527865b5bbc3fdbb39fddc294b0007a1adc1e575a970098fd0e3a59988cc09f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c01a566c50f0f32e15162b3ee1e484fd4507632967176a58aeeccd45199278367ea347093358f46d6411d675fbf49810b34104939c91baedc7f4fb62b45c8731
|
|
7
|
+
data.tar.gz: f16d7dd5d9ee7468098946e3b61a09188a3b2584ab2375b60adbb41f1b906b10d008d5bdef77b3fe3cc8559f69d9aac6f6b59195e4ff9e66d78e494e39907c0e
|
data/lib/glib/engine.rb
CHANGED
|
@@ -28,16 +28,21 @@ module Glib
|
|
|
28
28
|
#
|
|
29
29
|
# Opt-in: only consumers who run the gem's `create_snapshot_blob_references` migration
|
|
30
30
|
# have the table. The connection+table_exists? guard (wrapped in a rescue for boot
|
|
31
|
-
# sequences with no DB
|
|
32
|
-
#
|
|
31
|
+
# sequences with no DB reachable — `rails db:create`, parallel test setup, and DB-less
|
|
32
|
+
# build containers like docker's `assets:precompile`) makes this a no-op for everyone
|
|
33
|
+
# else, so a bare `include Glib::SnapshotV2` never crashes a boot.
|
|
33
34
|
unless respond_to?(:snapshot_blob_references)
|
|
34
35
|
begin
|
|
35
36
|
if connection.table_exists?(:snapshot_blob_references)
|
|
36
37
|
has_many :snapshot_blob_references, dependent: :destroy
|
|
37
38
|
end
|
|
38
|
-
rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid
|
|
39
|
-
|
|
40
|
-
#
|
|
39
|
+
rescue ActiveRecord::NoDatabaseError, ActiveRecord::StatementInvalid,
|
|
40
|
+
ActiveRecord::ConnectionNotEstablished
|
|
41
|
+
# NoDatabaseError/StatementInvalid: the server exists but the database doesn't yet
|
|
42
|
+
# (e.g. `rails db:create`). ConnectionNotEstablished: no server reachable at all —
|
|
43
|
+
# e.g. docker build's assets:precompile, where DATABASE_HOST is unset and pg falls
|
|
44
|
+
# back to the local socket. The association gets re-registered on the next
|
|
45
|
+
# successful boot that finds the table.
|
|
41
46
|
end
|
|
42
47
|
end
|
|
43
48
|
|