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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 881a76a5958f93883b6fe71571d149e0cd477a449484bc4d61df9fa7d49b7be0
4
- data.tar.gz: d3cb5f4ac6eb4a1d576904112ba85721164ed987ef7285d9ab7258c0a85062cc
3
+ metadata.gz: 3654e21a112ba4cfb15d661f705c72d1dffcffdec9ab3838ade05473929f8f0b
4
+ data.tar.gz: 62e14a4b78b57c911a4224ad00a5cefd3429499be6cf64e977807f3c4491d124
5
5
  SHA512:
6
- metadata.gz: 430b80997c899726116d97b067d8c42f30efffb44c160b7e91238ad714b6bbc6b15527ee372637be5eb41c77c44ef87fec943b460bb80a61cfc88eecf38899c1
7
- data.tar.gz: 5ce3bea3ce908809a6a233fa1d903128e37e039f7022969590cc9f6868f6ce6d3218aaa00618a8bd9b67acd53b722c679d5b0e665d6da593e8c3652f750737dc
6
+ metadata.gz: bf1b5b3fc1186296ab4f6d86e5c136cd2bda1df67a6a85e13d97cc2fc0e52616f301bc1b171cbe8f4f6e77e15609c5cd7394141ac952c1fd4bdaaac38d468ba0
7
+ data.tar.gz: f9f96171bf2b53c3250b978632513e79bcb3ad960f9cde88b482ec03f24292c7c4416c440b78d7b93e657c696d0e2ef9b1e00e3c4d27104bebe531a9e2f5265a
@@ -127,16 +127,19 @@ module Decanter
127
127
  end
128
128
 
129
129
  def handled_keys(args)
130
- handlers.reduce({}) do |m, h|
131
- name, handler = *h
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
- if handler[:options][:required] && Array(values).all?(&:blank?)
136
- empty_required_input_error(name)
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
- m.merge handle(handler, values)
142
+ acc.merge handle(handler, values)
140
143
  end
141
144
  end
142
145
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Decanter
4
- VERSION = '2.1.0'.freeze
4
+ VERSION = '2.1.1'.freeze
5
5
  end
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.0
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-01-10 00:00:00.000000000 Z
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
- rubyforge_project:
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