database_consistency 1.1.10 → 1.1.11
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: f837d273af4845f139d3dc53fd3131d4224383576939984865480b65a022ad07
|
4
|
+
data.tar.gz: acba58e69f8a8a8b2083318e983bac226c0681fb5925e927a412fee573ccdc7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386730f70655e59069f9d90a42a8dcba7d4ed9fefb61ac0d6abcd56bce725be7a699441f7d8b357964c773e06f3d362c6d289d1dfc19c1e334d1b2e956e64875
|
7
|
+
data.tar.gz: b37bee82b425c808658369824084fa92a93ff9a733464303b0343bfbf42f6c493286edafd87d051b78810c1d6b5d6eb85ba2fb09d637f10dca9bb22e35dce283
|
data/lib/database_consistency/checkers/validators_fraction_checkers/column_presence_checker.rb
CHANGED
@@ -18,7 +18,11 @@ module DatabaseConsistency
|
|
18
18
|
|
19
19
|
# We skip the check when there are no presence validators
|
20
20
|
def preconditions
|
21
|
-
validators.any?
|
21
|
+
validators.any? && !association?
|
22
|
+
end
|
23
|
+
|
24
|
+
def association?
|
25
|
+
model._reflect_on_association(attribute)&.macro == :has_one
|
22
26
|
end
|
23
27
|
|
24
28
|
# Table of possible statuses
|