Releases: LaunchPadLab/decanter
Releases · LaunchPadLab/decanter
v4.0.4
What's Changed
- Issue #142: Only one generator is documented by @nicoledow in #146
Full Changelog: v4.0.3...v4.0.4
v4.0.3
What's Changed
- 134 Enhance ReadMe with documentation on parser options by @nicoledow in #145
Full Changelog: v4.0.2...v4.0.3
v4.0.2
What's Changed
- 138 deprecation console warning message by @nicoledow in #141
Full Changelog: v4.0.1...v4.0.2
v4.0.1
What's Changed
- Truth string by @ryanmansfield in #137
New Contributors
- @ryanmansfield made their first contribution in #137
Full Changelog: v4.0.0...v4.0.1
v4.0.0
v3.5.1
v3.5.0
Items Addressed
Features
- Added a new
:ignore
option for strict mode. Setting this mode will ensure that unhandled keys are not included in the decanted hash. Previously, setting strict mode tofalse
would pass through all unhandled key-value pairs. This mode can be set globally or within each relevant Decanter
Fixes
- Fixed a key collision bug related to a handler with both
default_value
andkey
options defined
Kudos to @dianacamacho!
v3.4.2
v3.4.1
v3.4.0
Items Addressed
New Features
- Ability to handle a top level collection of objects (via autodetect or explicitly) via a singular object decanter. This eliminates the need to define collection decanters and improves developer experience
class TripDecanter < Decanter::Base
input :destination, :string
# ...
end
# Decanting a collection in <= 3.3.0
class TripCollectionDecanter < Decanter::Base
has_many :trips
end
params = { trips_attributes: [{ destination: 'Hawaii' }, { destination: 'Lisbon' }] }
trips = TripCollectionDecanter.decant(params)[:trips_attributes]
# Decanting a collection in >= 3.4.0
params = { trips: [{ destination: 'Hawaii' }, { destination: 'Lisbon' }] }
trips = TripDecanter.decant(params[:trips]))