Validations mixin for Ruby objects
- [Tim Riley] Remove all Ruby code from the gem. This gem now exists only to manage the dependency on dry-validation. (#230)
- Drop support for Ruby 3.0
- [Luca Guidi] Official support for Ruby 3.2
- [Tim Riley] Use Zeitwerk to autoload the gem
- [Tim Riley] Require latest dry-validation (to ensure best compatibility with Zeitwerk-enabled dry-rb gems) (#224)
- [Luca Guidi] Official support for Ruby: MRI 3.1
- [Luca Guidi] Official support for Ruby: MRI 3.0
- [Luca Guidi] Drop support for Ruby: MRI 2.4, 2.5
- [Luca Guidi] Introduced
Hanami::Validator
- [Luca Guidi] Added support to validate JSON data
- [Luca Guidi] Added rules
- [Luca Guidi] Allow to inherit validations from superclasses (e.g.
ApplicationValidator < Hanami::Validator
=>SignupValidator < ApplicationValidator
) - [Luca Guidi] Allow to error messages to receive arbitrary information as a
Hash
(e.g.error_code: 123
), which will be interpolated in the final error message. - [Luca Guidi] Added support for validator external dependencies
- [Luca Guidi] Drop support for Ruby: MRI 2.3, JRuby 9.1.
- [Luca Guidi] New validation syntax
- [Luca Guidi] Removed custom predicates (
Hanami::Validations.predicate
) - [Luca Guidi] Removed global custom predicates (
Hanami::Validations::Predicates
) - [Luca Guidi] Removed messages path setting (
Hanami::Validations.messages_path=
) - [Luca Guidi] Removed messages namespace setting (
Hanami::Validations.namespace
) - [Luca Guidi] Removed messages engine setting (
Hanami::Validations.messages
)
- [Panagiotis Matsinopoulos] Ensure
predicate
andpredicates
to work together
- [Luca Guidi] Official support for Ruby: MRI 2.7
- [ippachi] Ensure I18n doesn't crash when used for inline predicates
- [Luca Guidi] Ensure to load i18n backend (including
i18n
gem), when messages engine is:i18n
- [Luca Guidi] Depend on
dry-validation
~> 0.11
,< 0.12
- [Luca Guidi] Depend on
dry-logic
~> 0.4.2
,< 0.5
- [Luca Guidi] Depend on
dry-validation
~> 0.11.2
,< 0.12
in order to skip non compatibledry-logic
0.5.0
- [Luca Guidi] Official support for Ruby: MRI 2.6
- [Luca Guidi] Support
bundler
2.0+
- [Luca Guidi] Official support for JRuby 9.2.0.0
- [Luca Guidi] Revert dependency to
dry-validation
to~> 0.11
,< 0.12
- [Luca Guidi] Bump dependency to
dry-validation
to~> 0.12
- [Luca Guidi] Official support for Ruby: MRI 2.5
- [Luca Guidi] Official support for Ruby: MRI 2.4
- [Luca Guidi] Don't let inline predicates to discard other YAML error messages
- [Luca Guidi] Ensure custom validators to work with concrete classes with name
- [Luca Guidi] Official support for Ruby: MRI 2.3+ and JRuby 9.1.5.0+
- [Luca Guidi] Predicates syntax
- [Luca Guidi] Custom predicates
- [Luca Guidi] Inline predicates
- [Luca Guidi] Shared predicates
- [Luca Guidi] High level rules
- [Luca Guidi] Error messages with I18n support (
i18n
gem) - [Luca Guidi] Introduced
Hanami::Validations#validate
, which returns a result object. - [Luca Guidi] Introduced
Hanami::Validations::Form
mixin, which must be used when input comes from HTTP params or web forms.
– [Luca Guidi] Ensure to threat blank values as nil
– [Luca Guidi] Drop support for Ruby 2.0, 2.1 and Rubinius. Official support for JRuby 9.0.5.0+.
- [Luca Guidi] Validations must be wrapped in
.validations
block. - [Luca Guidi] Removed
.attribute
DSL. A validator doesn't create accessors (getters/setters) for validated keys. - [Luca Guidi] Removed
Hanami::Validations#valid?
in favor of#validate
. - [Luca Guidi] Error messages are accessible via result object. Eg.
result.errors
orresult.errors(full: true)
- [Luca Guidi] Coerced and sanitized data is accessible via result object. Eg.
result.output
- [Luca Guidi] Renamed the project
- [Hélio Costa e Silva & Luca Guidi] Ignore blank values for format and size validation
- [Pascal Betz] Ensure acceptance validation to reject blank strings
- [Luca Guidi] Official support for JRuby 9k+
- [deepj] Introduced
Lotus::Validations#invalid?
- [Luca Guidi] Fixed Hash serialization for nested validations. It always return nested
::Hash
structure. - [Alfonso Uceda Pompa & Dmitry Tymchuk] Fixed Hash serialization when
Lotus::Entity
is included in the same class.
- [Steve Hodgkiss] Introduced
Lotus::Validations::Error#attribute_name
- [Steve Hodgkiss] Nested validations
- [Steve Hodgkiss]
Lotus::Validations::Error#name
returns the complete attribute name (Eg.first_name
oraddress.street
)
- [Luca Guidi] Compatibility with Lotus::Entity
- [Luca Guidi] Ensure
.validates
usage to not raiseArgumentError
when:type
option is passed - [Luca Guidi] Ensure to assign attributes when only
.validates
is used
- [Steve Hodgkiss] Introduced
Validations.validates
. It defines validations, for already existing attributes.
- [Luca Guidi] Introduced
Validations::Errors#to_h
andto_a
- [Luca Guidi] Introduced
Validations::Errors#any?
- [Luca Guidi] Official support for Ruby 2.2
- [Satoshi Amemiya] Made
Validations#valid?
idempotent
- [Luca Guidi] Skip attribute whitelisting when a validator does not define any attribute
- [Luca Guidi] Official support for Rubinius 2.3+
- [Luca Guidi] Implemented
#each
in order to allow bulk operations on attributes - [Luca Guidi] Implemented
#to_h
to make validations usable by other libraries - [Luca Guidi] Made
#initialize
to accept Hashes with strings as keys, but only for declared attributes - [Luca Guidi] Lazy coercions, from now on
valid?
is not required to obtain a coerced value from a single attribute - [Rik Tonnard] Made validators reusable by allowing infinite inclusion
- [Luca Guidi] Made
#initialize
to accept any object that implements#to_h
- [Luca Guidi] Custom coercions for user defined classes
- [Luca Guidi] Raise an exception at the load time when a validation is not recognized
- [Luca Guidi] Allow validators inheritance
- [Luca Guidi] Confirmation validation
- [Luca Guidi] Exclusion validation
- [Luca Guidi] Size validation
- [Luca Guidi] Acceptance validation
- [Jeremy Stephens] Inclusion validation
- [Luca Guidi] Format validation
- [Luca Guidi] Presence validation
- [Luca Guidi] Coercions
- [Luca Guidi] Basic module inclusion
- [Luca Guidi] Official support for JRuby 1.7+ (with 2.0 mode)
- [Luca Guidi] Official support for MRI 2.0+
- [Jeremy Stephens] Ensure to not fail validations when coerce falsey values
- [Luca Guidi] Ensure
Lotus::Validations#valid?
to be idempotent