Last active
November 18, 2016 16:43
-
-
Save maltoe/befcdae03c3ba775ba511e0dd4ad44e6 to your computer and use it in GitHub Desktop.
dry-validation: array of hashes doesn't convey the nested input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'dry-validation' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
concurrent-ruby (1.0.2) | |
dry-configurable (0.3.0) | |
concurrent-ruby (~> 1.0) | |
dry-container (0.5.0) | |
concurrent-ruby (~> 1.0) | |
dry-configurable (~> 0.1, >= 0.1.3) | |
dry-core (0.2.1) | |
concurrent-ruby (~> 1.0) | |
dry-equalizer (0.2.0) | |
dry-logic (0.4.0) | |
dry-container (~> 0.2, >= 0.2.6) | |
dry-core (~> 0.1) | |
dry-equalizer (~> 0.2) | |
dry-types (0.9.2) | |
concurrent-ruby (~> 1.0) | |
dry-configurable (~> 0.1) | |
dry-container (~> 0.3) | |
dry-core (~> 0.2) | |
dry-equalizer (~> 0.2) | |
dry-logic (~> 0.4, >= 0.4.0) | |
inflecto (~> 0.0.0, >= 0.0.2) | |
dry-validation (0.10.3) | |
concurrent-ruby (~> 1.0) | |
dry-configurable (~> 0.1, >= 0.1.3) | |
dry-container (~> 0.2, >= 0.2.8) | |
dry-core (~> 0.1) | |
dry-equalizer (~> 0.2) | |
dry-logic (~> 0.4, >= 0.4.0) | |
dry-types (~> 0.9, >= 0.9.0) | |
inflecto (0.0.2) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
dry-validation | |
BUNDLED WITH | |
1.12.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dry-validation' | |
s = Dry::Validation.Form do | |
required(:items).each do | |
schema do | |
required(:title).filled?(:str?) | |
end | |
end | |
end | |
puts s.(items: [{title: 'abc'}]).output | |
# => {:items=>[{}]} | |
# ?!? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment