Skip to content

Releases: LaunchPadLab/decanter

v4.0.4

11 Jan 20:20
5234600
Compare
Choose a tag to compare

What's Changed

Full Changelog: v4.0.3...v4.0.4

v4.0.3

11 Jan 20:14
682539d
Compare
Choose a tag to compare

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

11 Jan 20:13
1953bbf
Compare
Choose a tag to compare

What's Changed

Full Changelog: v4.0.1...v4.0.2

v4.0.1

31 Mar 16:22
acd7e38
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.0.0...v4.0.1

v4.0.0

23 Nov 15:56
45a54d5
Compare
Choose a tag to compare

Items Addressed

Breaking Changes

  • Fixed issue where Float and Integer parsers incorrectly parsed negative string values as positive floats and integers, respectively #125

v3.5.1

13 Apr 21:16
28c3938
Compare
Choose a tag to compare

Items Addressed

Fixes

  • Allows collection_option to be passed (#116)
  • Allows collection detection for all Decanters, not just ActiveRecord model extension methods (#118)

v3.5.0

23 Jan 14:45
74b30db
Compare
Choose a tag to compare

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 to false 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 and key options defined

Kudos to @dianacamacho!

v3.4.2

05 Jan 20:29
2f18945
Compare
Choose a tag to compare

Items Addressed

  • Decanters can be dynamically derived from a model class in Rails 5.2.3 (or any version that has ApplicationRecord class names as frozen strings)

v3.4.1

30 Dec 16:46
88af7fe
Compare
Choose a tag to compare

Items Addressed

  • Removes pinned version of ActiveSupport to improve compatibility with older (and newer) Rails projects

v3.4.0

05 Nov 15:47
0921df9
Compare
Choose a tag to compare

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]))