formalist 0.5.3 → 0.5.4

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: e72bedbab8ce756587489fd79622e5c8930205f0e0cb64821a387d68c7ad6e87
4
- data.tar.gz: d820f822b06b3b451fa162e90aed12175bde9fab761680ce2ae72d30074b6dd9
3
+ metadata.gz: 1323fdd5950cdc3185d1f5c97095c2b6b5a4c895122eb56e422a65a583b116cf
4
+ data.tar.gz: bf631eb58ccd943f01099a551cb5dc390897e96e84bee193054adb07d0c35e11
5
5
  SHA512:
6
- metadata.gz: 2cc98709e8211355ac2b209c571cf5615587c868ccbfc1f5f04ac04bc835998ded25fdcd29f6224e59bc49ac9e7060c0b32aebf35851048266fc244cc5126e85
7
- data.tar.gz: ce216b64927599d999a4e804fb33ae10c19d2e3f2489c410dad7fd2a79ffada160aed13395dfceabf6f75d425868db0b47c2cf5f94b781b6e014d73f5640dce1
6
+ metadata.gz: d3846cadc6cafa398dbb644ed6963e793d644e28e0e4a428bf285a4d369c27285bbd77f99cf7a0f889dfd37665b0bdfaa70da4ebde74394400ff0d4954eacd53
7
+ data.tar.gz: 41a5a177e35653ce0afc4ea48d5760dc80b9ff35728bdd558b2163d9530acf1a84741983bb571372f61116e1caa29879d56f23d2cb6dcf32b4d26bea32a63138
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.5.4 / 2018-11-28
2
+
3
+ ### Fixed
4
+
5
+ - Fixed the rendering of validation errors when validating a `Many` element itself
6
+
1
7
  # 0.5.3 / 2018-09-25
2
8
 
3
9
  ### Added
@@ -31,9 +31,11 @@ module Formalist
31
31
  input = input.fetch(name) { [] }
32
32
  errors = errors.fetch(name) { {} }
33
33
 
34
+ # Errors look like this when they are on the array itself: ["size cannot be greater than 2"]
35
+ # Errors look like this when they are on children: {0=>{:summary=>["must be filled"]}
36
+
34
37
  children = input.each_with_index.map { |child_input, index|
35
- # Child errors look like this: {0=>{:summary=>["must be filled"]}
36
- child_errors = errors.fetch(index) { {} }
38
+ child_errors = errors.is_a?(Hash) ? errors.fetch(index) { {} } : {}
37
39
 
38
40
  child_template.map { |child| child.fill(input: child_input, errors: child_errors) }
39
41
  }
@@ -1,3 +1,3 @@
1
1
  module Formalist
2
- VERSION = "0.5.3".freeze
2
+ VERSION = "0.5.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formalist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Riley
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-24 00:00:00.000000000 Z
11
+ date: 2018-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.7.7
233
+ rubygems_version: 2.7.6
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Flexible form builder