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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2736ff3b70e0272398ad66b54b72783d4c2c6c440cabd273ac4a1c706ca3dcb3
|
|
4
|
+
data.tar.gz: e929cf7e44486bb01521a1b11ed5600b1250c0a7de9d74101a5dbd476ddc7b35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
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.
|
|
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-
|
|
11
|
+
date: 2026-08-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|