Skip to content

Releases: dry-rb/dry-types

v1.9.1

06 Feb 05:17
v1.9.1
1a13fb0

Choose a tag to compare

v1.9.0

08 Jan 23:44
v1.9.0
adb1373

Choose a tag to compare

Added

  • params.* with .optional can now handle empty strings consistently with optional.params.* by returning nil instead of raising an error. (@baweaver in #487, @flash-gordon in #490)

    This behavior is not enabled by default because it's a breaking change. Set Dry::Types.use_namespaced_optionals(true) to enable it.

    Dry::Types["params.integer"].optional.("") # => CoercionError
    # Activate namespaced optionals
    Dry::Types.use_namespaced_optionals true
    Dry::Types["params.integer"].optional.("") # => nil

Changed

  • Require Ruby 3.2 or later.
  • Support bigdecimal version 4.0 as well as 3.0, improving compatibility with other gems that require 4.0 only. (@rus-max in #492)
  • Improve sum type error handling documentation. (@baweaver in #486)

Fixed

  • Fix Constructor#primitive? delegation for sum types. (@baweaver in #484)

    This now works without error:

    a = Types::String.constrained(size: 2) | Types::Hash
    b = Types::String.constrained(size: 1) | Types::Hash
    
    c = (a.constructor { |x| x.is_a?(Hash) ? x : x.downcase }) |
        (b.constructor { |x| x.is_a?(Hash) ? x : x.upcase })
  • Fix Sum type to_s with Dry::Struct types. (@baweaver in #485)

    This now works without error:

    class A < Dry::Struct; end
    class B < Dry::Struct; end
    
    (A | B).to_s

Compare v1.8.3 ... v1.9.0

v1.8.3

09 Jun 09:25
v1.8.3

Choose a tag to compare

Fixed

Compare v1.8.2...v1.8.3

v1.8.2

31 Jan 11:23
v1.8.2

Choose a tag to compare

Fixed

Compare v1.8.1...v1.8.2

v1.8.1

21 Jan 11:35
v1.8.1
ce2103f

Choose a tag to compare

Fixed

Compare v1.8.0...v1.8.1

v1.8.0

06 Jan 13:55
v1.8.0

Choose a tag to compare

Added

Fixed

Changed

Compare v1.7.2...v1.8.0

v1.7.2

05 Jan 06:28
v1.7.2

Choose a tag to compare

Fixed

  • Fixed BigDecimal warning due to not being required in gemspec (@bkuhlmann in #464)

Compare v1.7.1...v1.7.2

v1.7.1

17 Feb 07:58
v1.7.1

Choose a tag to compare

Fixed

Compare v1.7.0...v1.7.1

v1.7.0

04 Nov 17:02
v1.7.0

Choose a tag to compare

Changed

Compare v1.6.1...v1.7.0

v1.6.1

15 Oct 07:53
v1.6.1

Choose a tag to compare

Changed

Compare v1.6.0...v1.6.1