database_consistency 1.1.15 → 1.2.0
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: f18ab981e7a995312fcefac4aad1673991c0ca74f83e892ed443b55399f73621
|
4
|
+
data.tar.gz: '0284902da44ea88322df42739eb9471212970ff4a2bde3ea91c491a0b3b6a8c6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3765a63635638981d1a7389ed4d5f4a611d188c08281a13fc2ae5c435e4da8ad09a9a0f49511be596126d75caca322a3a7bd16309d27914adcfcb386a135223a
|
7
|
+
data.tar.gz: 6473f6990528f09bbb90e6e044b0e1c506b9c9586c65f2b76f8efaed68f1cb91d914703e11ba3747ce0663f9999e33065d7d5b0f5dbce44672a3ca33bd3be94f
|
@@ -37,22 +37,30 @@ module DatabaseConsistency
|
|
37
37
|
def enabled?(*path)
|
38
38
|
current = configuration
|
39
39
|
|
40
|
+
value = global_enabling
|
41
|
+
|
40
42
|
path.each do |key|
|
41
43
|
current = current[key.to_s]
|
42
|
-
return
|
44
|
+
return value unless current.is_a?(Hash)
|
43
45
|
|
44
46
|
next if current['enabled'].nil?
|
45
47
|
|
46
|
-
|
48
|
+
value = current['enabled']
|
47
49
|
end
|
48
50
|
|
49
|
-
|
51
|
+
value
|
50
52
|
end
|
51
53
|
|
52
54
|
private
|
53
55
|
|
54
56
|
attr_reader :configuration
|
55
57
|
|
58
|
+
def global_enabling
|
59
|
+
value = configuration.dig('DatabaseConsistencyCheckers', 'All', 'enabled')
|
60
|
+
|
61
|
+
value.nil? ? true : value
|
62
|
+
end
|
63
|
+
|
56
64
|
def load_yaml_config_file(filepath)
|
57
65
|
if YAML.respond_to?(:safe_load_file)
|
58
66
|
YAML.safe_load_file(filepath, aliases: true)
|
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.
|
4
|
+
version: 1.2.0
|
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-
|
11
|
+
date: 2022-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
202
|
+
rubygems_version: 3.3.21
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Provide an easy way to check the consistency of the database constraints
|