validate-params 0.13.1 → 0.14.0
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/.ruby-version +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +6 -4
- data/lib/validate_params/param_validator.rb +6 -4
- data/lib/validate_params/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fae87e49e657c4474eb70cecc2b42f3b8431cd2838539c5892d74d8d6ada70ef
|
4
|
+
data.tar.gz: e24d98df25519a3b937aacce314f4a89c50154121277d0f9ea6131bc199e9205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e543564a6a1f9e983a3315a82ca53ec64eba95efaa9937dc01cf0165c0d513173c3e3a5255acced136631cadfcb7154aba5f81b2c885a419e4fef5cc4ed65e88
|
7
|
+
data.tar.gz: a2a5c8fb0392f70d0b7d03d06e9d78391c751c676202705dd4ffc2c116f09234ec12a20f3da94d3b285002feb405f91ec39e12703ded3b97a82c631a21723aaa
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.3.4
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
validate-params (0.
|
4
|
+
validate-params (0.14.0)
|
5
5
|
activesupport (>= 6.1.0)
|
6
6
|
i18n (>= 1.6)
|
7
7
|
|
@@ -29,11 +29,11 @@ GEM
|
|
29
29
|
zeitwerk (~> 2.3)
|
30
30
|
ast (2.4.2)
|
31
31
|
builder (3.2.4)
|
32
|
-
concurrent-ruby (1.2.
|
32
|
+
concurrent-ruby (1.2.3)
|
33
33
|
crass (1.0.6)
|
34
34
|
diff-lcs (1.5.1)
|
35
35
|
erubi (1.12.0)
|
36
|
-
i18n (1.
|
36
|
+
i18n (1.14.5)
|
37
37
|
concurrent-ruby (~> 1.0)
|
38
38
|
json (2.7.2)
|
39
39
|
language_server-protocol (3.17.0.3)
|
@@ -61,7 +61,8 @@ GEM
|
|
61
61
|
rainbow (3.1.1)
|
62
62
|
rake (13.2.1)
|
63
63
|
regexp_parser (2.9.0)
|
64
|
-
rexml (3.2.
|
64
|
+
rexml (3.2.8)
|
65
|
+
strscan (>= 3.0.9)
|
65
66
|
rspec (3.13.0)
|
66
67
|
rspec-core (~> 3.13.0)
|
67
68
|
rspec-expectations (~> 3.13.0)
|
@@ -89,6 +90,7 @@ GEM
|
|
89
90
|
rubocop-ast (1.31.2)
|
90
91
|
parser (>= 3.3.0.4)
|
91
92
|
ruby-progressbar (1.13.0)
|
93
|
+
strscan (3.1.0)
|
92
94
|
tzinfo (2.0.6)
|
93
95
|
concurrent-ruby (~> 1.0)
|
94
96
|
unicode-display_width (2.5.0)
|
@@ -119,20 +119,22 @@ module ValidateParams
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def validate_min(value)
|
122
|
-
|
122
|
+
min_value = @options[:min].is_a?(Proc) ? @options[:min].call : @options[:min]
|
123
|
+
return if min_value <= value
|
123
124
|
|
124
125
|
@errors << {
|
125
126
|
message: I18n.t("validate_params.less_than_min", param: error_param_name),
|
126
|
-
min:
|
127
|
+
min: min_value
|
127
128
|
}
|
128
129
|
end
|
129
130
|
|
130
131
|
def validate_max(value)
|
131
|
-
|
132
|
+
max_value = @options[:max].is_a?(Proc) ? @options[:max].call : @options[:max]
|
133
|
+
return if max_value >= value
|
132
134
|
|
133
135
|
@errors << {
|
134
136
|
message: I18n.t("validate_params.more_than_max", param: error_param_name),
|
135
|
-
max:
|
137
|
+
max: max_value
|
136
138
|
}
|
137
139
|
end
|
138
140
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validate-params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dcherevatenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -103,6 +103,7 @@ extra_rdoc_files: []
|
|
103
103
|
files:
|
104
104
|
- ".rspec"
|
105
105
|
- ".rubocop.yml"
|
106
|
+
- ".ruby-version"
|
106
107
|
- CHANGELOG.md
|
107
108
|
- Gemfile
|
108
109
|
- Gemfile.lock
|
@@ -146,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
147
|
- !ruby/object:Gem::Version
|
147
148
|
version: '0'
|
148
149
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
150
|
+
rubygems_version: 3.5.11
|
150
151
|
signing_key:
|
151
152
|
specification_version: 4
|
152
153
|
summary: Gem to validate params in controllers
|