changelogs.md


blueprinter-ruby/blueprinter

Repository  -  API  -  Source

1.1.2

February 6, 2023
  • ๐Ÿ’… [ENHANCEMENT] Introduce rubocop and add a Github action for it

1.1.1

February 6, 2023
  • ๐Ÿ› [BUGFIX] Fix accidental hard dependency requirement of yajl and oj in gemspec from a routine cleanup commit

1.1.0

February 2, 2023
  • ๐Ÿš€ [FEATURE] Allow configuring custom array-like classes to be treated as collections when serializing. More details can be found here. Thanks to @toddnestor.
  • ๐Ÿ’… [ENHANCEMENT] Reduce object allocations in fields calculations to save some memory. More details can be found here. Thanks to @nametoolong.

1.0.0

January 5, 2023
  • ๐Ÿš€ [Official Release] Released blueprinter-rb under a new organisation. More details can be found here.

0.25.3

March 3, 2021
  • ๐Ÿ› [BUGFIX] Fixes issue where fields and associations that are redefined by later views were not properly overwritten. See #201 thanks to @Berardpi.

0.25.2

November 19, 2020
  • ๐Ÿš€ [FEATURE] Make deprecation behavior configurable (:silence, :stderror, :raise). See #248 thanks to @mcclayton.

0.25.1

August 18, 2020
  • ๐Ÿ› [BUGFIX] Raise Blueprinter::BlueprinterError if Blueprint given is not of class Blueprinter::Base. Before it just raised a generic undefined method 'prepare'. See #233 thanks to @caws.

0.25.0

July 6, 2020
  • ๐Ÿš€ [FEATURE] Enable default Blueprinter::Transformers to be set in the global configuration. #222. Thanks to @supremebeing7.

0.24.0

June 22, 2020
  • ๐Ÿš€ [FEATURE] Add an options option to associations to facilitate passing options from one blueprint to another. #220. Thanks to @mcclayton.

0.23.4

April 28, 2020
  • ๐Ÿš€ [FEATURE] Public class method has_view? on Blueprinter::Base subclasses introduced in #213. Thanks to @spencerneste.

0.23.3

April 7, 2020
  • ๐Ÿ› [BUGFIX] Fixes issue where exclude fields in deeply nested views were not respected. Resolved issue 207 in #208 by @tpltn.

0.23.2

March 16, 2020
  • ๐Ÿ› [BUGFIX] Fixes issue where fields "bled" into other views due to merge side-effects. Resolved issue 205 in #204 by @trevorrjohn.

0.23.1

March 13, 2020
  • ๐Ÿ› [BUGFIX] Fixes #172 where views would unintentionally ignore sort_fields_by: :definition configuration. Resolved in #197 by @wlkrw.

0.23.0

January 31, 2020
  • ๐Ÿš€ [FEATURE] Configurable default extractor introduced in #198 by @wlkrw. You can now set a default extractor like so:
Blueprinter.configure do |config|
  config.extractor_default = MyAutoExtractor
end

0.22.0

December 26, 2019
  • ๐Ÿš€ [FEATURE] Add rails generators. See rails g blueprinter:blueprint --help for usage. Introduced in #176 by @wlkrw.

0.21.0

December 19, 2019
  • ๐Ÿš€ [FEATURE] Ability to specify default_if field/association option for more control on when the default value is applied. 191. Thanks to @mcclayton.

0.20.0

October 15, 2019
  • ๐Ÿš€ [FEATURE] Ability to include multiple views in a single method call with include_views. 184. Thanks to @narendranvelmurugan.

  • ๐Ÿ’… [ENHANCEMENT] Update field-level conditional settings to reflect new three-argument syntax. 183. Thanks to @danirod.

  • ๐Ÿ’… [ENHANCEMENT] Modify Extractor access control in documentation. 182. Thanks to @cagmz.

  • ๐Ÿ’… [ENHANCEMENT] Fix the Transformer example documentation. 174. Thanks to @tjwallace.

0.19.0

July 24, 2019
  • ๐Ÿš€ [FEATURE] Added ability to specify transformers for Blueprinter views to further process the resulting hash before serialization. #164. Thanks to @amalarayfreshworks.

0.18.0

May 29, 2019
  • โš ๏ธ [DEPRECATION] :if/:unless procs with two arguments are now deprecated. These procs now take in three arguments (field_name, obj, options) instead of just (obj, options). In order to be compliant with the the next major release, all conditional :if/:unless procs must be augmented to take in three arguments instead of two. i.e. (obj, options) to (field_name, obj, options).

0.17.0

May 23, 2019
  • ๐Ÿ› [BUGFIX] Fixing view: :identifier including non-identifier fields. #154. Thanks to @AllPurposeName.

  • ๐Ÿ’… [ENHANCEMENT] Add ability to override :extractor option for an ::association. #152. Thanks to @hugopeixoto.

0.16.0

April 3, 2019
  • ๐Ÿš€ [FEATURE] Add ability to exclude multiple fields inline using excludes. #141. Thanks to @pabhinaya.

0.15.0

April 1, 2019
  • ๐Ÿš€ [FEATURE] Add ability to pass in datetime_format field option as either a string representing the strftime format, or a Proc which takes in the Date or DateTime object and returns the formatted date. #145. Thanks to @mcclayton.

0.14.0

April 1, 2019
  • ๐Ÿš€ [FEATURE] Added a global datetime_format option. #135. Thanks to @ritikesh.

0.13.2

March 14, 2019
  • ๐Ÿ› [BUGFIX] Replacing use of rails-specific method Hash::except so that Blueprinter continues to work in non-Rails environments. #140. Thanks to @checkbutton.

0.13.1

March 2, 2019
  • ๐Ÿ’… [MAINTENANCE | ENHANCEMENT] Cleaning up the include_associations section. This is not a documented/supported feature and is calling respond_to?(:klass) on every object passed to blueprinter. #139. Thanks to @ritikesh.

0.13.0

February 7, 2019
  • ๐Ÿš€ [FEATURE] Added an option to render with a root key. #135. Thanks to @ritikesh.
  • ๐Ÿš€ [FEATURE] Added an option to render with a top-level meta attribute. #135. Thanks to @ritikesh.

0.12.1

January 24, 2019
  • ๐Ÿ› [BUGFIX] Fix boolean false values getting serialized as null. Please see PR #132. Thanks to @samsongz.

0.12.0

January 16, 2019
  • ๐Ÿš€ [FEATURE] Enables the setting of global :field_default and :association_default option value in the Blueprinter Configuration that will be used as default values for fields and associations that evaluate to nil. #128. Thanks to @mcclayton.

0.11.0

January 15, 2019
  • ๐Ÿš€ [FEATURE] Enables the setting of a global :if/:unless proc in the Blueprinter Configuration that will be used to evaluate the conditional render of all fields. #127. Thanks to @mcclayton.

0.10.0

December 20, 2018
  • ๐Ÿš€ [FEATURE] Association Blueprints can be dynamically evaluated using a proc. #122. Thanks to @ritikesh.

0.9.0

November 29, 2018
  • ๐Ÿš€ [FEATURE] Added a render_as_json API. Similar to render_as_hash but returns a JSONified hash. Please see pr #119. Thanks to @ritikesh.
  • ๐Ÿš€ [FEATURE] Sorting of fields in the response is now configurable to sort by definition or by name(asc only). Please see pr #119. Thanks to @ritikesh.
  • ๐Ÿ’… [ENHANCEMENT] Updated readme for above features and some existing undocumented features like exclude fields, render_as_hash. Please see pr #119. Thanks to @ritikesh.

0.8.0

November 19, 2018
  • ๐Ÿš€ [FEATURE] Extend Support for other JSON encoders like yajl-ruby. Please see pr #118. Thanks to @ritikesh.
  • ๐Ÿ› [BUGFIX] Do not raise error on null date with date_format option. Please see pr #117. Thanks to @tpltn.
  • ๐Ÿš€ [FEATURE] Add default option to fields which will be used as the serialized value instead of null when the field evaluates to null. Please see pr #115. Thanks to @mcclayton.
  • ๐Ÿ› [BUGFIX] Made Base.associations completely private since they are not used outside of the Blueprinter base. Please see pr #112. Thanks to @philipqnguyen.
  • ๐Ÿ› [BUGFIX] Fix issue where entire Blueprinter module was marked api private. Please see pr #111. Thanks to @philipqnguyen.
  • ๐Ÿš€ [FEATURE] Allow identifiers to be defined with a block. Please see pr #110. Thanks to @hugopeixoto.
  • ๐Ÿ’… [ENHANCEMENT] Update docs regarding the args yielded to blocks. Please see pr #108. Thanks to @philipqnguyen.
  • ๐Ÿ’… [ENHANCEMENT] Use field method in fields. Please see pr #107. Thanks to @hugopeixoto.

0.7.0

October 17, 2018
  • [FEATURE] Allow associations to be defined with a block. Please see pr #106. Thanks to @hugopeixoto.
  • [FEATURE] Inherit view definition when using inheritance. Please see pr #105. Thanks to @hugopeixoto.

0.6.0

June 5, 2018
  • ๐Ÿš€ [FEATURE] Add date_time format as an option to field. Please see pr #68. Thanks to @njbbaer.
  • ๐Ÿš€ [FEATURE] Add conditional field support :unless and :if as an option to field. Please see pr #86. Thanks to @ojab.
  • ๐Ÿ› [BUGFIX] Fix case where miscellaneous options were not being passed through the AutoExtractor. See pr #83.

0.5.0

May 15, 2018
  • ๐Ÿš€ [FEATURE] Add default option to association which will be used as the serialized value instead of null when the association evaluates to null. See PR #78 by @vinaya-procore.

0.4.0

May 2, 2018
  • ๐Ÿš€ [FEATURE] Add render_as_hash which will output a hash instead of a JSON String. See PR #76 by @amayer171 and Issue #73.

0.3.0

April 5, 2018

๐Ÿ’ฅ [BREAKING] Sort of a breaking Change. Serializer classes has been renamed to Extractor. To upgrade, if you passed in a specific serializer to field or identifier such as:

field(:first_name, serializer: CustomSerializer)

Please rename that to:

field(:first_name, extractor: CustomExtractor)
  • ๐Ÿ’… [ENHANCEMENT] Renamed Serializer classes to Extractor. See #72.
  • ๐Ÿ’… [ENHANCEMENT] Updated README. See pr #66, #65

0.2.0

January 22, 2018

๐Ÿ’ฅ [BREAKING] Breaking Changes. To upgrade, ensure that any associated objects have a blueprint. For example:

association :comments, blueprint: CommentsBlueprint
  • ๐Ÿ› [BUGFIX] Remove Optimizer class. See #61.
  • ๐Ÿ› [BUGFIX] Require associated objects to have a Blueprint, so that objects will always serialize properly. See #60.

0.1.0

January 17, 2018
  • ๐Ÿš€ [FEATURE] Initial release of Blueprinter