api-regulator 0.1.13 → 0.1.14
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/api_regulator/validator.rb +5 -5
- data/lib/api_regulator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01bd1b3f0bc005db798835f26a3d5f4f210892efecae2ae4e7472905a2acce86
|
4
|
+
data.tar.gz: f5e49bb413b8f981863d1bd4f5df9abab840b92549a51910768517e9d7b278ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f5780dca825a9b6935894eb9ce30c88cd1cb458adcad5e365460dc837b77c6f2bed10f2cd5fa3c8827edbf53b81df24d96a053ea74ac2321e7509de3336868d
|
7
|
+
data.tar.gz: 7283943527bce68a444cbc3739d2aaa80d5618bec6259798838e12670ee78c9addd3b8b93e11adb0b025cae81fc71075f57764a4a56e4294f780ec84dc73751d
|
data/Gemfile.lock
CHANGED
@@ -30,9 +30,9 @@ module ApiRegulator
|
|
30
30
|
self.defined_attributes += [full_key]
|
31
31
|
|
32
32
|
param.options.each do |option, value|
|
33
|
-
validates full_key,
|
34
|
-
|
35
|
-
|
33
|
+
validates full_key,
|
34
|
+
option => value,
|
35
|
+
if: ->(record) { param.required?(validation_context) || record.raw_attributes.key?(param.name) }
|
36
36
|
end
|
37
37
|
|
38
38
|
# Add type-specific validations
|
@@ -151,11 +151,11 @@ module ApiRegulator
|
|
151
151
|
return
|
152
152
|
end
|
153
153
|
|
154
|
-
inclusion_list = param.options
|
154
|
+
inclusion_list = param.options.dig(:inclusion, :in)
|
155
155
|
|
156
156
|
raw_value.each_with_index do |value, index|
|
157
157
|
# Skip type and inclusion validation if nil is allowed and value is nil
|
158
|
-
if value.nil? && (inclusion_list&.include?(nil) || param.options
|
158
|
+
if value.nil? && (inclusion_list&.include?(nil) || param.options.dig(:inclusion, :allow_nil))
|
159
159
|
next
|
160
160
|
end
|
161
161
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api-regulator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Massanek
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|