database_consistency 3.0.8 → 3.0.9

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: d1a3f79e718dbab025a1077436d34a99f96441d4c38ea6eeab44b48a9d47017b
4
- data.tar.gz: 3d923752051575203683bf72e4fa91d538e668d0f3259be1a3c85f078bd35fc8
3
+ metadata.gz: 2736ff3b70e0272398ad66b54b72783d4c2c6c440cabd273ac4a1c706ca3dcb3
4
+ data.tar.gz: e929cf7e44486bb01521a1b11ed5600b1250c0a7de9d74101a5dbd476ddc7b35
5
5
  SHA512:
6
- metadata.gz: 483695e3e1bfb73d833f71832f770e6783bab926c785bb54e097a0f527adc66a33112e7c83f3e7f1f849d5f0015d8f16e01bcff135d55933c683f76dbb58626d
7
- data.tar.gz: f0686a44bb3fe3e842ad8b9f72a4b11801cad4745c389665d015bc0255529709b4b4f843d4a97a5064e5ede8643c3f5d36b800c2c4f63ad7b0f4bf6119544f4b
6
+ metadata.gz: '02578765fe026f0bfc2bd5e830d8ed198cd44322af9565ab7b94627774a47368af47ec23f28a53387a53c9488ec0e5c1749e714cf38c558769cc399307ae8297'
7
+ data.tar.gz: 1004d6702f5b31462b3e35bbe400a8429612802249505be2837e3108b13fe91f0b2ba4dfbc49082c95a2f59635e9d05d728a692c5a04c534fca881b645169dd5
@@ -11,11 +11,25 @@ module DatabaseConsistency
11
11
  ].freeze
12
12
  PLAIN_IDENTIFIER_PATTERN =
13
13
  /\b([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)?)\b(?!\s*\()/.freeze
14
+ # Without one of these options, `numericality` only asserts "is a number",
15
+ # which the column's numeric type already guarantees. There is no
16
+ # corresponding CHECK constraint to look for in that case, so validators
17
+ # with none of these options are skipped.
18
+ # Listed explicitly rather than excluding the known non-range options
19
+ # (`only_integer`, `allow_nil`, ...) so that an unrecognized option never
20
+ # makes us demand a constraint that cannot exist. The tradeoff is that a
21
+ # future range option must be added here to be reported on.
22
+ RANGE_OPTIONS = %i[
23
+ greater_than greater_than_or_equal_to
24
+ less_than less_than_or_equal_to
25
+ equal_to other_than in
26
+ ].freeze
14
27
 
15
28
  private
16
29
 
17
30
  def filter(validator)
18
- validator.kind == :numericality
31
+ validator.kind == :numericality &&
32
+ validator.options.slice(*RANGE_OPTIONS).any?
19
33
  end
20
34
 
21
35
  def preconditions
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '3.0.8'
4
+ VERSION = '3.0.9'
5
5
  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: 3.0.8
4
+ version: 3.0.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: 2026-07-28 00:00:00.000000000 Z
11
+ date: 2026-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord