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. ie rule(:foo) { value } returns values[:foo] (solnic)

    ๐Ÿ›  Fixed

    • 0๏ธโƒฃ Contract's config.locale option was replaced by config.messages.default_locale to avoid conflicts with run-time :locale option and/or whatever is set via I18n 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 raise InvalidKeysError when specified keys are not defined by the schema (solnic)
    • Contract.new will raise SchemaMissingError when the class doesn't have schema defined (solnic)
    • ๐Ÿ‘ Contracts no longer support :locale option in the constructor. Use Result#errors(locale: :pl) to change locale at run-time (solnic)

    Compare v1.0.0.rc3...v1.0.0