dry-validation v1.0.0 Release Notes
Release Date: 2019-06-10 // almost 5 years ago-
โ Added
- ๐ Support for defining rules for each element of an array via
rule(:items).each { ... }
(solnic) - Support for parameterized macros via
rule(:foo).validate(my_macro: :some_option)
(solnic) values#[]
is now compatible with path specs (symbol, array with keys or dot-notation) (issue #528) (solnic)value
shortcut for accessing the value found under the first key specified by a rule. ierule(:foo) { value }
returnsvalues[:foo]
(solnic)
๐ Fixed
- 0๏ธโฃ Contract's
config.locale
option was replaced byconfig.messages.default_locale
to avoid conflicts with run-time:locale
option and/or whatever is set viaI18n
gem (solnic) - Macros no longer mutate
Dry::Validation::Contract.macros
when using inheritance (solnic) - Missing dependency on
dry-container
was added (solnic)
๐ Changed
rule
will raiseInvalidKeysError
when specified keys are not defined by the schema (solnic)Contract.new
will raiseSchemaMissingError
when the class doesn't have schema defined (solnic)- ๐ Contracts no longer support
:locale
option in the constructor. UseResult#errors(locale: :pl)
to change locale at run-time (solnic)
- ๐ Support for defining rules for each element of an array via