database_consistency 1.1.10 → 1.1.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b191ca6be5af749e9c3e7bd634696e5ecc648972f5b882954990bcc9e13dde2
4
- data.tar.gz: 460e7edbac351faf21032e9d71c768d0e98b12ddafad792516bc5f4158122525
3
+ metadata.gz: f837d273af4845f139d3dc53fd3131d4224383576939984865480b65a022ad07
4
+ data.tar.gz: acba58e69f8a8a8b2083318e983bac226c0681fb5925e927a412fee573ccdc7b
5
5
  SHA512:
6
- metadata.gz: 4b1da4a7207245abc904aa28fcbbf2d8fe7c15683f86ad55557ba10b6d7699103404c42ed33a6fda82a413e4a6ed73681579dfd9512c7480d60a5f3da7d9d335
7
- data.tar.gz: a4a13d8527677783f144448bfbe892d282086fffbe6dd04121aa50052d435c2d370eee32ee7c378047a2cf47817fcee4b74b9e7d0f9ed4b652d80431948196cc
6
+ metadata.gz: 386730f70655e59069f9d90a42a8dcba7d4ed9fefb61ac0d6abcd56bce725be7a699441f7d8b357964c773e06f3d362c6d289d1dfc19c1e334d1b2e956e64875
7
+ data.tar.gz: b37bee82b425c808658369824084fa92a93ff9a733464303b0343bfbf42f6c493286edafd87d051b78810c1d6b5d6eb85ba2fb09d637f10dca9bb22e35dce283
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '1.1.10'
4
+ VERSION = '1.1.11'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_consistency
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin