decanter 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/decanter/core.rb +8 -5
- data/lib/decanter/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3654e21a112ba4cfb15d661f705c72d1dffcffdec9ab3838ade05473929f8f0b
|
4
|
+
data.tar.gz: 62e14a4b78b57c911a4224ad00a5cefd3429499be6cf64e977807f3c4491d124
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf1b5b3fc1186296ab4f6d86e5c136cd2bda1df67a6a85e13d97cc2fc0e52616f301bc1b171cbe8f4f6e77e15609c5cd7394141ac952c1fd4bdaaac38d468ba0
|
7
|
+
data.tar.gz: f9f96171bf2b53c3250b978632513e79bcb3ad960f9cde88b482ec03f24292c7c4416c440b78d7b93e657c696d0e2ef9b1e00e3c4d27104bebe531a9e2f5265a
|
data/lib/decanter/core.rb
CHANGED
@@ -127,16 +127,19 @@ module Decanter
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def handled_keys(args)
|
130
|
-
handlers.reduce({}) do |
|
131
|
-
name, handler = *
|
130
|
+
handlers.reduce({}) do |acc, curr|
|
131
|
+
name, handler = *curr
|
132
132
|
values = args.values_at(*name)
|
133
133
|
values = values.length == 1 ? values.first : values
|
134
134
|
|
135
|
-
|
136
|
-
|
135
|
+
is_empty_input = Array(values).all?(&:blank?)
|
136
|
+
if is_empty_input
|
137
|
+
empty_required_input_error(name) if handler[:options][:required]
|
138
|
+
# Skip handling empty inputs
|
139
|
+
next acc
|
137
140
|
end
|
138
141
|
|
139
|
-
|
142
|
+
acc.merge handle(handler, values)
|
140
143
|
end
|
141
144
|
end
|
142
145
|
|
data/lib/decanter/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decanter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Francis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -174,8 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
- !ruby/object:Gem::Version
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
|
-
|
178
|
-
rubygems_version: 2.7.6
|
177
|
+
rubygems_version: 3.0.6
|
179
178
|
signing_key:
|
180
179
|
specification_version: 4
|
181
180
|
summary: Form Parser for Rails
|