hanami-validations/CHANGELOG.md

306 lines
7.8 KiB
Markdown
Raw Permalink Normal View History

2016-01-19 17:48:15 +00:00
# Hanami::Validations
2022-07-10 13:00:35 +00:00
2014-11-22 14:46:04 +00:00
Validations mixin for Ruby objects
2022-11-07 09:55:51 +00:00
## v2.0.0.rc1 - 2022-11-08
2022-10-24 12:18:46 +00:00
## v2.0.0.beta4 - 2022-10-24
### Changed
- [Tim Riley] Require latest dry-validation (to ensure best compatibility with Zeitwerk-enabled dry-rb gems) (#224)
2022-07-18 08:17:35 +00:00
## v2.0.0.beta1 - 2022-07-20
2022-07-10 13:00:35 +00:00
### Added
- [Luca Guidi] Official support for Ruby: MRI 3.1
2021-05-03 13:50:20 +00:00
## v2.0.0.alpha2 - 2021-05-04
2022-07-10 13:00:35 +00:00
### Added
2021-05-03 13:50:20 +00:00
- [Luca Guidi] Official support for Ruby: MRI 3.0
2022-07-10 13:00:35 +00:00
### Changed
2021-05-03 13:50:20 +00:00
- [Luca Guidi] Drop support for Ruby: MRI 2.4, 2.5
2019-07-26 06:28:27 +00:00
## v2.0.0.alpha1 - 2019-07-26
2022-07-10 13:00:35 +00:00
2019-07-04 12:15:12 +00:00
### Added
2022-07-10 13:00:35 +00:00
2019-07-04 12:15:12 +00:00
- [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
2019-01-26 15:35:38 +00:00
### Changed
2022-07-10 13:00:35 +00:00
2019-07-04 12:15:12 +00:00
- [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`)
2019-01-26 15:35:38 +00:00
2021-01-06 10:10:34 +00:00
## v1.3.7 - 2021-01-06
2022-07-10 13:00:35 +00:00
2021-01-06 10:10:34 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2021-01-06 10:10:34 +00:00
- [Panagiotis Matsinopoulos] Ensure `predicate` and `predicates` to work together
2020-01-08 13:11:52 +00:00
## v1.3.6 - 2020-01-08
2022-07-10 13:00:35 +00:00
2020-01-08 13:11:52 +00:00
### Added
2022-07-10 13:00:35 +00:00
2020-01-08 13:11:52 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.7
2019-09-13 08:16:17 +00:00
## v1.3.5 - 2019-07-26
2022-07-10 13:00:35 +00:00
2019-09-13 08:16:17 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2019-09-13 08:16:17 +00:00
- [ippachi] Ensure I18n doesn't crash when used for inline predicates
2019-07-26 06:16:46 +00:00
## v1.3.4 - 2019-07-26
2022-07-10 13:00:35 +00:00
2019-07-26 06:16:46 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2019-07-26 06:16:46 +00:00
- [Luca Guidi] Ensure to load i18n backend (including `i18n` gem), when messages engine is `:i18n`
## v1.3.3 - 2019-01-31
2022-07-10 13:00:35 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
- [Luca Guidi] Depend on `dry-validation` `~> 0.11`, `< 0.12`
- [Luca Guidi] Depend on `dry-logic` `~> 0.4.2`, `< 0.5`
## v1.3.2 - 2019-01-30
2022-07-10 13:00:35 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
- [Luca Guidi] Depend on `dry-validation` `~> 0.11.2`, `< 0.12` in order to skip non compatible `dry-logic` `0.5.0`
2019-01-18 15:01:50 +00:00
## v1.3.1 - 2019-01-18
2022-07-10 13:00:35 +00:00
2019-01-15 08:12:14 +00:00
### Added
2022-07-10 13:00:35 +00:00
2019-01-15 08:12:14 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.6
- [Luca Guidi] Support `bundler` 2.0+
2018-10-23 06:28:31 +00:00
## v1.3.0 - 2018-10-24
2018-08-02 14:39:42 +00:00
## v1.3.0.beta1 - 2018-08-08
2022-07-10 13:00:35 +00:00
2018-08-02 14:39:42 +00:00
### Added
2022-07-10 13:00:35 +00:00
2018-08-02 14:39:42 +00:00
- [Luca Guidi] Official support for JRuby 9.2.0.0
2018-04-12 07:06:51 +00:00
2018-06-05 12:30:09 +00:00
## v1.2.2 - 2018-06-05
2022-07-10 13:00:35 +00:00
2018-06-05 12:30:09 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2018-06-05 12:30:09 +00:00
- [Luca Guidi] Revert dependency to `dry-validation` to `~> 0.11`, `< 0.12`
## v1.2.1 - 2018-06-04
2022-07-10 13:00:35 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
- [Luca Guidi] Bump dependency to `dry-validation` to `~> 0.12`
2018-04-10 08:32:06 +00:00
## v1.2.0 - 2018-04-11
2018-04-05 14:49:43 +00:00
## v1.2.0.rc2 - 2018-04-06
2018-03-29 12:58:15 +00:00
## v1.2.0.rc1 - 2018-03-30
2018-03-23 10:17:26 +00:00
## v1.2.0.beta2 - 2018-03-23
2018-02-27 14:09:59 +00:00
## v1.2.0.beta1 - 2018-02-28
2022-07-10 13:00:35 +00:00
2018-02-27 14:09:59 +00:00
### Added
2022-07-10 13:00:35 +00:00
2018-02-27 14:09:59 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.5
2017-10-24 14:50:50 +00:00
## v1.1.0 - 2017-10-25
2017-10-15 11:26:58 +00:00
## v1.1.0.rc1 - 2017-10-16
2017-10-04 09:31:28 +00:00
## v1.1.0.beta3 - 2017-10-04
2017-10-03 09:23:36 +00:00
## v1.1.0.beta2 - 2017-10-03
2017-08-11 20:46:31 +00:00
## v1.1.0.beta1 - 2017-08-11
2017-08-09 09:44:27 +00:00
2017-04-05 08:33:16 +00:00
## v1.0.0 - 2017-04-06
2017-03-31 04:52:08 +00:00
## v1.0.0.rc1 - 2017-03-31
2017-03-17 09:27:58 +00:00
## v1.0.0.beta2 - 2017-03-17
2017-03-08 14:23:16 +00:00
2017-02-14 13:34:56 +00:00
## v1.0.0.beta1 - 2017-02-14
2022-07-10 13:00:35 +00:00
2017-02-14 13:34:56 +00:00
### Added
2022-07-10 13:00:35 +00:00
2017-02-14 13:34:56 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.4
2017-02-08 15:44:12 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2017-02-08 15:44:12 +00:00
- [Luca Guidi] Don't let inline predicates to discard other YAML error messages
2016-11-18 15:04:13 +00:00
## v0.7.1 - 2016-11-18
2022-07-10 13:00:35 +00:00
2016-11-18 15:04:13 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2016-11-18 15:04:13 +00:00
- [Luca Guidi] Ensure custom validators to work with concrete classes with name
2016-11-15 12:57:40 +00:00
## v0.7.0 - 2016-11-15
2022-07-10 13:00:35 +00:00
2016-11-09 12:55:00 +00:00
### Changed
2022-07-10 13:00:35 +00:00
2016-11-09 12:55:00 +00:00
- [Luca Guidi] Official support for Ruby: MRI 2.3+ and JRuby 9.1.5.0+
2016-07-22 17:24:50 +00:00
## v0.6.0 - 2016-07-22
2022-07-10 13:00:35 +00:00
2016-07-06 14:42:06 +00:00
### Added
2022-07-10 13:00:35 +00:00
2016-07-06 14:42:06 +00:00
- [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.
### Fixed
2022-07-10 13:00:35 +00:00
2016-07-06 14:42:06 +00:00
[Luca Guidi] Ensure to threat blank values as `nil`
2016-02-08 09:07:46 +00:00
### Changed
2022-07-10 13:00:35 +00:00
2016-07-06 14:42:06 +00:00
[Luca Guidi] Drop support for Ruby 2.0, 2.1 and Rubinius. Official support for JRuby 9.0.5.0+.
2022-07-10 13:00:35 +00:00
2016-07-06 14:42:06 +00:00
- [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` or `result.errors(full: true)`
- [Luca Guidi] Coerced and sanitized data is accessible via result object. Eg. `result.output`
2016-02-08 09:07:46 +00:00
2016-01-22 17:49:54 +00:00
## v0.5.0 - 2016-01-22
2022-07-10 13:00:35 +00:00
2016-01-22 11:35:10 +00:00
### Changed
2022-07-10 13:00:35 +00:00
2016-01-22 17:49:54 +00:00
- [Luca Guidi] Renamed the project
2016-01-22 11:35:10 +00:00
2016-01-07 16:53:20 +00:00
## v0.4.0 - 2016-01-12
2022-07-10 13:00:35 +00:00
2016-01-07 16:53:20 +00:00
## Changed
2022-07-10 13:00:35 +00:00
2016-01-07 16:53:20 +00:00
- [Hélio Costa e Silva & Luca Guidi] Ignore blank values for format and size validation
2016-01-11 13:08:47 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2016-01-11 13:08:47 +00:00
- [Pascal Betz] Ensure acceptance validation to reject blank strings
2015-09-29 14:44:37 +00:00
## v0.3.3 - 2015-09-30
2022-07-10 13:00:35 +00:00
2015-09-28 12:07:21 +00:00
### Added
2022-07-10 13:00:35 +00:00
2015-09-28 12:07:21 +00:00
- [Luca Guidi] Official support for JRuby 9k+
2015-09-18 07:43:25 +00:00
2015-05-21 08:54:50 +00:00
## v0.3.2 - 2015-05-22
2022-07-10 13:00:35 +00:00
2015-09-28 12:07:21 +00:00
### Added
2022-07-10 13:00:35 +00:00
2016-01-22 17:49:54 +00:00
- [deepj] Introduced `Lotus::Validations#invalid?`
2015-05-21 08:54:50 +00:00
2015-05-15 08:45:58 +00:00
## v0.3.1 - 2015-05-15
2022-07-10 13:00:35 +00:00
2015-05-15 08:45:58 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2015-05-15 08:45:58 +00:00
- [Luca Guidi] Fixed Hash serialization for nested validations. It always return nested `::Hash` structure.
2016-01-22 17:49:54 +00:00
- [Alfonso Uceda Pompa & Dmitry Tymchuk] Fixed Hash serialization when `Lotus::Entity` is included in the same class.
2015-05-15 08:45:58 +00:00
2015-03-19 11:17:38 +00:00
## v0.3.0 - 2015-03-23
2015-01-29 10:31:15 +00:00
## v0.2.4 - 2015-01-30
2022-07-10 13:00:35 +00:00
2015-01-29 10:31:15 +00:00
### Added
2022-07-10 13:00:35 +00:00
2016-01-22 17:49:54 +00:00
- [Steve Hodgkiss] Introduced `Lotus::Validations::Error#attribute_name`
2015-01-29 10:31:15 +00:00
- [Steve Hodgkiss] Nested validations
### Changed
2022-07-10 13:00:35 +00:00
2016-01-22 17:49:54 +00:00
- [Steve Hodgkiss] `Lotus::Validations::Error#name` returns the complete attribute name (Eg. `first_name` or `address.street`)
2015-01-29 10:31:15 +00:00
2015-01-12 15:22:13 +00:00
## v0.2.3 - 2015-01-12
2022-07-10 13:00:35 +00:00
2015-01-12 15:22:13 +00:00
### Added
2022-07-10 13:00:35 +00:00
2016-01-22 17:49:54 +00:00
- [Luca Guidi] Compatibility with Lotus::Entity
2015-01-12 15:22:13 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2015-01-12 15:22:13 +00:00
- [Luca Guidi] Ensure `.validates` usage to not raise `ArgumentError` when `:type` option is passed
- [Luca Guidi] Ensure to assign attributes when only `.validates` is used
## v0.2.2 - 2015-01-08
2022-07-10 13:00:35 +00:00
2015-01-07 09:51:54 +00:00
### Added
2022-07-10 13:00:35 +00:00
2015-01-07 09:51:54 +00:00
- [Steve Hodgkiss] Introduced `Validations.validates`. It defines validations, for already existing attributes.
2014-12-19 09:59:55 +00:00
## v0.2.1 - 2014-12-23
2022-07-10 13:00:35 +00:00
2014-12-19 09:59:55 +00:00
### Added
2022-07-10 13:00:35 +00:00
2014-12-19 09:59:55 +00:00
- [Luca Guidi] Introduced `Validations::Errors#to_h` and `to_a`
- [Luca Guidi] Introduced `Validations::Errors#any?`
- [Luca Guidi] Official support for Ruby 2.2
2014-12-19 09:59:55 +00:00
### Fixed
2022-07-10 13:00:35 +00:00
2014-12-19 09:59:55 +00:00
- [Satoshi Amemiya] Made `Validations#valid?` idempotent
2014-11-22 14:46:04 +00:00
## v0.2.0 - 2014-11-23
2022-07-10 13:00:35 +00:00
2014-11-22 14:46:04 +00:00
### Added
2022-07-10 13:00:35 +00:00
2014-11-22 14:46:04 +00:00
- [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
## v0.1.0 - 2014-10-23
2022-07-10 13:00:35 +00:00
2014-11-22 14:46:04 +00:00
### Added
2022-07-10 13:00:35 +00:00
2014-11-22 14:46:04 +00:00
- [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+
### Fixed
2022-07-10 13:00:35 +00:00
2014-11-22 14:46:04 +00:00
- [Jeremy Stephens] Ensure to not fail validations when coerce falsey values
2016-01-22 17:49:54 +00:00
- [Luca Guidi] Ensure `Lotus::Validations#valid?` to be idempotent