Repository - API - Source
blueprinter-rb
under a new organisation. More details can be found here.:silence
, :stderror
, :raise
). See #248 thanks to @mcclayton.Blueprinter::Transformer
s to be set in the global configuration. #222. Thanks to @supremebeing7.options
option to associations to facilitate passing options from one blueprint to another. #220. Thanks to @mcclayton.has_view?
on Blueprinter::Base subclasses introduced in #213. Thanks to @spencerneste.default_if
field/association option for more control on when the default value is applied. 191. Thanks to @mcclayton.๐ [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.
(obj, options)
to (field_name, obj, options)
.๐ [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.
excludes
. #141. Thanks to @pabhinaya.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.Hash::except
so that Blueprinter continues to work in non-Rails environments. #140. Thanks to @checkbutton.: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.:if
/:unless
proc in the Blueprinter Configuration that will be used to evaluate the conditional render of all fields. #127. Thanks to @mcclayton.render_as_json
API. Similar to render_as_hash
but returns a JSONified hash. Please see pr #119. Thanks to @ritikesh.exclude fields
, render_as_hash
. Please see pr #119. Thanks to @ritikesh.date_format
option. Please see pr #117. Thanks to @tpltn.default
option to field
s which will be used as the serialized value instead of null
when the field evaluates to null. Please see pr #115. Thanks to @mcclayton.field
method in fields. Please see pr #107. Thanks to @hugopeixoto.date_time
format as an option to field
. Please see pr #68. Thanks to @njbbaer.:unless
and :if
as an option to field
. Please see pr #86. Thanks to @ojab.AutoExtractor
. See pr #83.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.render_as_hash
which will output a hash instead of
a JSON String. See PR #76 by @amayer171 and Issue #73.๐ฅ [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)
๐ฅ [BREAKING] Breaking Changes. To upgrade, ensure that any associated objects have a blueprint. For example:
association :comments, blueprint: CommentsBlueprint