dry-validation v0.8.0 Release Notes
Release Date: 2016-07-01 // almost 8 years ago-
โ Added
- Explicit interface for type specs used to set up coercions, ie
required(:age, :int)
(solnic) - Support new dry-logic predicates:
:excluded_from?
,:excludes?
,:included_in?
,:includes?
,:not_eql?
,:odd?
,:even?
(jodosha, fran-worley) - ๐ Support for blocks in
value
,filled
andmaybe
macros (solnic) - ๐ Support for passing a schema to
value|filled|maybe
macros iemaybe(SomeSchema)
(solnic) - ๐ Support for
each(SomeSchema)
(solnic) - ๐ Support for
value|filled|maybe
macros +each
inside a block ie:maybe(:filled?) { each(:int?) }
(solnic) - ๐ Support for dedicated hint messages via
en.errors.#{predicate}.(hint|failure)
look-up paths (solnic) - ๐ Support for configuring custom DSL extensions via
dsl_extensions
setting on Schema class (solnic) - ๐ Support for preconfiguring a predicate for the input value ie
value :hash?
used for prerequisite-checks (solnic) - Infer coercion from constrained types (solnic)
- โ Add value macro (coop)
- Enable .schema to accept objects that respond to #schema (ttdonovan)
- ๐ Support for schema predicates which don't need any arguments (fran-worley)
- 0๏ธโฃ Error and hint messages have access to all predicate arguments by default (fran-worley+solnic)
- Invalid predicate name in DSL will raise an error (solnic)
- Predicate with invalid arity in DSL will raise an error (solnic)
๐ Fixed
- ๐ Support for jRuby 9.1.1.0 (flash-gordon)
- ๐ Fix bug when using predicates with options in each and when (fran-worley)
- ๐ Fix bug when validating custom types (coop)
- ๐ Fix depending on deeply nested values in high-lvl rules (solnic)
- ๐ Fix duplicated error message for lt? when hint was used (solnic)
- ๐ Fix hints for nested schemas (solnic)
- ๐ Fix an issue where rules with same names inside nested schemas have incorrect hints (solnic)
- ๐ Fix a bug where hints were being generated 4 times (solnic)
- ๐ Fix duplicated error messages when message is different than a hint (solnic)
๐ Changed
- ๐ Uses new
:weak
hash constructor from dry-types 0.8.0 which can partially coerce invalid hash (solnic) - ๐
key
has been deprecated in favor ofrequired
(coop) - ๐
required
has been deprecated in favor offilled
(coop) - Now relies on dry-logic v0.3.0 and dry-types v0.8.0 (fran-worley)
- Tring to use illogical predicates with maybe and filled macros now raise InvalidSchemaError (fran-worley)
- Enable coercion on form.true and form.false (fran-worley)
- โ Remove attr (will be extracted to a separate gem) (coop)
- ๐ Deprecate required in favour of filled (coop)
- ๐ Deprecate key in favor of required (coop)
- โ Remove nested key syntax (solnic)
- Explicit interface for type specs used to set up coercions, ie