Reform v2.3.0 Release Notes
-
โฌ๏ธ You can upgrade from 2.2.0 without worries.
- โ Require Representable 3.0.0 and removed Representable 2.4 deprecation code.
- ๐ Require Disposable 0.4.0 which fixes issues with
nil
field values,sync {}
and dry-validation. - ๐ Fix boolean coercion.
- ๐ Allow using
:populator
classes marked withUber::Callable
. - ๐ Introduce
parse: false
as a shortcut fordeserialzer: { writeable: false}
. Thanks to @pabloh for insisting on this handy change. - ๐ Memoize the deserializer instance on the class level via
::deserializer
. This saves the inferal of a deserializing representer and speeds up following calls by 130%. - ๐ Deprecated positional arguments for
validation :default, options: {}
. New API:validation name: :default, **
. - ๐ง Reform now maintains a generic
Dry::Schema
class for global schema configuration. Can be overridden via::validation
. - When validating with dry-validation, we now pass a symbolized hash. We also replaced
Dry::Validation::Form
withSchema
which won't coerce values where it shouldn't. - [private]
Group#call
API now is:call(form, errors)
. - Modify
Form#valid?
- simply callsvalidate({})
. - In
:if
for validation groups, you now get a hash of result objects, not just true/false. - ๐ Allow adding a custom error AFTER validate has been already called
Compatibility with
dry-validation
with 1.x:๐ [CHANGE] seems like "custom" predicate are not supported by
dry-schema
anymore or better the same result is reached using therule
method: Something like this:validation do def a_song?(value) value == :really_cool_song end required(:songs).filled(:a_song?) end
will be something like:
validation do required(:songs).filled rule(:songs) do key.failure(:a_song?) unless value == :really_cool_song end end
๐ [BREAKING] inheriting/merging/overriding schema/rules is not supported by
dry-v
so theinherit:
option is NOT SUPPORTED for now. Also extend aschema:
option using a block is NOT SUPPORTED for now. Possible workaround is to use reform module to compose different validations but this won't override existing validations but just merge them