@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
6
6
and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
7
7
8
+ ## [ 2.6.0] [ 2018-09-09]
9
+
10
+ ### Fixed
11
+ - ` nil ` coercion (belousovAV)
12
+
13
+ When default value is ` nil ` instead of ` Dry::Initializer::UNDEFINED ` ,
14
+ the coercion should be applied to any value, including ` nil ` , because
15
+ we cannot distinct "undefined" ` nil ` from the "assigned" ` nil ` value.
16
+
8
17
## [ 2.4.0] [ 2018-02-01]
9
18
10
19
### Added
@@ -367,18 +376,20 @@ and to @gzigzigzeo for persuading me to do this refactoring.
367
376
### Added
368
377
- enhancement via `Dry::Initializer::Attribute.dispatchers` registry (nepalez)
369
378
370
- # Register dispatcher for `:string` option
371
- Dry::Initializer::Attribute.dispatchers << ->(string: nil, **op) do
372
- string ? op.merge(type: proc(&:to_s)) : op
373
- end
379
+ ```ruby
380
+ # Register dispatcher for `:string` option
381
+ Dry::Initializer::Attribute.dispatchers << ->(string: nil, **op) do
382
+ string ? op.merge(type: proc(&:to_s)) : op
383
+ end
374
384
375
- # Now you can use the `:string` key for `param` and `option`
376
- class User
377
- extend Dry::Initializer
378
- param :name, string: true
379
- end
385
+ # Now you can use the `:string` key for `param` and `option`
386
+ class User
387
+ extend Dry::Initializer
388
+ param :name, string: true
389
+ end
380
390
381
- User.new(:Andy).name # => "Andy"
391
+ User.new(:Andy).name # => "Andy"
392
+ ```
382
393
383
394
### Changed
384
395
- optimize assignments for performance (nepalez)
@@ -757,4 +768,5 @@ First public release
757
768
[ 2.1.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.0.0...v2.1.0
758
769
[ 2.2.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.1.0...v2.2.0
759
770
[ 2.3.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.2.0...v2.3.0
760
- [ 2.4.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.3.0...v2.4.0
771
+ [ 2.4.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.3.0...v2.4.0
772
+ [ 2.6.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.5.0...v2.6.0
0 commit comments