database_consistency 1.7.7 → 1.7.9
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: 199d6a4e4c313048e4e1abf5e980fec96d4703704a837024fbb6e507ab36bc7f
|
4
|
+
data.tar.gz: db33237e3cc031b90ebae5001a4d99b5c398f6a2324d6016275b8501b2f39e10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30639e1cfed1a67db161d01dcd1fd8d1f2511fcb062bebb9371a9a690d2054ae5936fb13a0a158db26c2bcb60b89560c1fd17a936c402ae72e62a7c611a732ee
|
7
|
+
data.tar.gz: 6b891e83dd31d2a9fcfb76ac53d3aa1186e203daebb27c252084cf7208cfa0c3f091dbbe92cb63cb98b0dc48f2939718b6fc85a9f72430e79a9882799c6b1a94
|
@@ -27,8 +27,9 @@ module DatabaseConsistency
|
|
27
27
|
|
28
28
|
# Returns list of models to check
|
29
29
|
def models
|
30
|
-
ActiveRecord::Base.descendants.
|
31
|
-
klass.
|
30
|
+
ActiveRecord::Base.descendants.select do |klass|
|
31
|
+
!klass.abstract_class? &&
|
32
|
+
klass.connection.table_exists?(klass.table_name) &&
|
32
33
|
!klass.name.include?('HABTM_') &&
|
33
34
|
project_klass?(klass)
|
34
35
|
end
|
@@ -12,11 +12,20 @@ module DatabaseConsistency
|
|
12
12
|
assign_result(hash, result)
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
sorted_hash = sort(h)
|
16
|
+
|
17
|
+
File.write(file_name, sorted_hash.to_yaml)
|
16
18
|
end
|
17
19
|
|
18
20
|
private
|
19
21
|
|
22
|
+
def sort(obj)
|
23
|
+
return obj unless obj.is_a?(Hash)
|
24
|
+
|
25
|
+
obj.sort_by { |(k, _)| k }
|
26
|
+
.to_h { |k, v| [k, sort(v)] }
|
27
|
+
end
|
28
|
+
|
20
29
|
def write?(status)
|
21
30
|
status == :fail
|
22
31
|
end
|
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.7.
|
4
|
+
version: 1.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Demin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|