database_consistency 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f2d13b99e730f1045b98f63239a77820a81908d2ec05232461bf12275489d5d
|
4
|
+
data.tar.gz: 7f92339d4b0241a15f422f64fdd80eab8db3f64c7cd8c405f91d787851fa3400
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4970958fca4670dda454bdaf699e96c013fc443d9bfeea4e11638ed2ad38f567f1f07ddec0785310bfac9e7afc58dd014df94872519c6ed4b7bfb3a405cc5a75
|
7
|
+
data.tar.gz: b3656fa0f395f2e87914b4d217eeea445b9fca195d5db0a4ca9ac596bdf5a81a5662c18dc714a1191a9f61fe714814706428cff6c0816e295ffa15650ffd7917
|
@@ -25,8 +25,13 @@ module DatabaseConsistency
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# @return [Array<Hash>]
|
28
|
-
def reports
|
28
|
+
def reports(catch_errors: true)
|
29
29
|
@reports ||= check
|
30
|
+
rescue StandardError => e
|
31
|
+
raise e unless catch_errors
|
32
|
+
|
33
|
+
RescueError.call(e)
|
34
|
+
[]
|
30
35
|
end
|
31
36
|
|
32
37
|
# @return [Array<Class>]
|
@@ -16,7 +16,7 @@ module DatabaseConsistency
|
|
16
16
|
Helper.parent_models.flat_map do |model|
|
17
17
|
next unless configuration.enabled?(model.name.to_s)
|
18
18
|
|
19
|
-
indexes =
|
19
|
+
indexes = model.connection.indexes(model.table_name)
|
20
20
|
|
21
21
|
indexes.flat_map do |index|
|
22
22
|
enabled_checkers.map do |checker_class|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_consistency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Demin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
|
-
rubygems_version: 3.3.
|
203
|
+
rubygems_version: 3.0.3.1
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: Provide an easy way to check the consistency of the database constraints
|