blueprinter-rb 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blueprinter/configuration.rb +10 -1
- data/lib/blueprinter/helpers/type_helpers.rb +3 -5
- data/lib/blueprinter/version.rb +1 -1
- data/lib/blueprinter/view_collection.rb +6 -8
- metadata +15 -20
- data/CHANGELOG.md +0 -167
- data/README.md +0 -1050
- data/Rakefile +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2677856ada1ec34dc3bb38b0dc3f24ab6a857f4609e57b5f69468b5eb6923f31
|
4
|
+
data.tar.gz: bc9bca49804600bdeeb9e19d8d4440b71e55b7e896c1192ba65d7dd36c0783d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b58aacfa832985a5b544346d4134ebce31a3fd51b812a81c9c5ffb874e8493dbf90b5f966be010b7dbbb4d60a1c2c2fa68352d2ad847a828e8bea8d415bb349
|
7
|
+
data.tar.gz: 11b1727bf5765ef8b47055269343cc0f005013e67ef3e23282067075a158fc0589369491babae34c8b899b9092298d6e52b15ac260c05817aa023d71297021e7
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Blueprinter
|
4
4
|
class Configuration
|
5
|
-
attr_accessor :association_default, :datetime_format, :deprecations, :field_default, :generator, :if, :method, :sort_fields_by, :unless, :extractor_default, :default_transformers
|
5
|
+
attr_accessor :association_default, :datetime_format, :deprecations, :field_default, :generator, :if, :method, :sort_fields_by, :unless, :extractor_default, :default_transformers, :custom_array_like_classes
|
6
6
|
|
7
7
|
VALID_CALLABLES = %i(if unless).freeze
|
8
8
|
|
@@ -18,6 +18,15 @@ module Blueprinter
|
|
18
18
|
@unless = nil
|
19
19
|
@extractor_default = AutoExtractor
|
20
20
|
@default_transformers = []
|
21
|
+
@custom_array_like_classes = []
|
22
|
+
end
|
23
|
+
|
24
|
+
def array_like_classes
|
25
|
+
@array_like_classes ||= [
|
26
|
+
Array,
|
27
|
+
defined?(ActiveRecord::Relation) && ActiveRecord::Relation,
|
28
|
+
*custom_array_like_classes
|
29
|
+
].compact
|
21
30
|
end
|
22
31
|
|
23
32
|
def jsonify(blob)
|
@@ -3,13 +3,11 @@
|
|
3
3
|
module Blueprinter
|
4
4
|
module TypeHelpers
|
5
5
|
private
|
6
|
-
def active_record_relation?(object)
|
7
|
-
!!(defined?(ActiveRecord::Relation) &&
|
8
|
-
object.is_a?(ActiveRecord::Relation))
|
9
|
-
end
|
10
6
|
|
11
7
|
def array_like?(object)
|
12
|
-
|
8
|
+
Blueprinter.configuration.array_like_classes.any? do |klass|
|
9
|
+
object.is_a?(klass)
|
10
|
+
end
|
13
11
|
end
|
14
12
|
end
|
15
13
|
end
|
data/lib/blueprinter/version.rb
CHANGED
@@ -28,7 +28,9 @@ module Blueprinter
|
|
28
28
|
fields, excluded_fields = sortable_fields(view_name)
|
29
29
|
sorted_fields = sort_by_definition ? sort_by_def(view_name, fields) : fields.values.sort_by(&:name)
|
30
30
|
|
31
|
-
(identifier_fields + sorted_fields).
|
31
|
+
(identifier_fields + sorted_fields).tap do |fields|
|
32
|
+
fields.reject! { |field| excluded_fields.include?(field.name) }
|
33
|
+
end
|
32
34
|
end
|
33
35
|
|
34
36
|
def transformers(view_name)
|
@@ -49,15 +51,15 @@ module Blueprinter
|
|
49
51
|
# @return [Array<(Hash, Hash<String, NilClass>)>] fields, excluded_fields
|
50
52
|
def sortable_fields(view_name)
|
51
53
|
excluded_fields = {}
|
52
|
-
fields = views[:default].fields
|
54
|
+
fields = views[:default].fields.clone
|
53
55
|
views[view_name].included_view_names.each do |included_view_name|
|
54
56
|
next if view_name == included_view_name
|
55
57
|
|
56
58
|
view_fields, view_excluded_fields = sortable_fields(included_view_name)
|
57
|
-
fields
|
59
|
+
fields.merge!(view_fields)
|
58
60
|
excluded_fields.merge!(view_excluded_fields)
|
59
61
|
end
|
60
|
-
fields
|
62
|
+
fields.merge!(views[view_name].fields) unless view_name == :default
|
61
63
|
|
62
64
|
views[view_name].excluded_field_names.each { |name| excluded_fields[name] = nil }
|
63
65
|
|
@@ -82,9 +84,5 @@ module Blueprinter
|
|
82
84
|
ordered_fields[definition.name] = fields[definition.name]
|
83
85
|
end
|
84
86
|
end
|
85
|
-
|
86
|
-
def merge_fields(source_fields, included_fields)
|
87
|
-
source_fields.merge included_fields
|
88
|
-
end
|
89
87
|
end
|
90
88
|
end
|
metadata
CHANGED
@@ -1,59 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blueprinter-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Adam Hess
|
8
|
-
- Derek Carter
|
9
7
|
- Ritikesh G
|
10
8
|
autorequire:
|
11
9
|
bindir: bin
|
12
10
|
cert_chain: []
|
13
|
-
date: 2023-
|
11
|
+
date: 2023-02-06 00:00:00.000000000 Z
|
14
12
|
dependencies:
|
15
13
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
14
|
+
name: oj
|
17
15
|
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
19
|
+
version: '3.13'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
23
|
requirements:
|
26
24
|
- - "~>"
|
27
25
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
26
|
+
version: '3.13'
|
29
27
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
28
|
+
name: yajl-ruby
|
31
29
|
requirement: !ruby/object:Gem::Requirement
|
32
30
|
requirements:
|
33
31
|
- - "~>"
|
34
32
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
33
|
+
version: '1.4'
|
36
34
|
type: :development
|
37
35
|
prerelease: false
|
38
36
|
version_requirements: !ruby/object:Gem::Requirement
|
39
37
|
requirements:
|
40
38
|
- - "~>"
|
41
39
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
40
|
+
version: '1.4'
|
43
41
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
42
|
+
name: factory_bot
|
45
43
|
requirement: !ruby/object:Gem::Requirement
|
46
44
|
requirements:
|
47
45
|
- - "~>"
|
48
46
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
47
|
+
version: '6.2'
|
50
48
|
type: :development
|
51
49
|
prerelease: false
|
52
50
|
version_requirements: !ruby/object:Gem::Requirement
|
53
51
|
requirements:
|
54
52
|
- - "~>"
|
55
53
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
54
|
+
version: '6.2'
|
57
55
|
- !ruby/object:Gem::Dependency
|
58
56
|
name: pry
|
59
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,16 +70,16 @@ dependencies:
|
|
72
70
|
name: activerecord
|
73
71
|
requirement: !ruby/object:Gem::Requirement
|
74
72
|
requirements:
|
75
|
-
- - "
|
73
|
+
- - ">="
|
76
74
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
75
|
+
version: '5.2'
|
78
76
|
type: :development
|
79
77
|
prerelease: false
|
80
78
|
version_requirements: !ruby/object:Gem::Requirement
|
81
79
|
requirements:
|
82
|
-
- - "
|
80
|
+
- - ">="
|
83
81
|
- !ruby/object:Gem::Version
|
84
|
-
version: '
|
82
|
+
version: '5.2'
|
85
83
|
- !ruby/object:Gem::Dependency
|
86
84
|
name: rspec
|
87
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,10 +160,7 @@ executables: []
|
|
162
160
|
extensions: []
|
163
161
|
extra_rdoc_files: []
|
164
162
|
files:
|
165
|
-
- CHANGELOG.md
|
166
163
|
- MIT-LICENSE
|
167
|
-
- README.md
|
168
|
-
- Rakefile
|
169
164
|
- lib/blueprinter.rb
|
170
165
|
- lib/blueprinter/base.rb
|
171
166
|
- lib/blueprinter/blueprinter_error.rb
|
data/CHANGELOG.md
DELETED
@@ -1,167 +0,0 @@
|
|
1
|
-
## 0.25.3 - 2021/03/03
|
2
|
-
* 🐛 [BUGFIX] Fixes issue where fields and associations that are redefined by later views were not properly overwritten. See [#201](https://github.com/procore/blueprinter/pull/201) thanks to [@Berardpi](https://github.com/Berardpi).
|
3
|
-
|
4
|
-
## 0.25.2 - 2020/11/19
|
5
|
-
* 🚀 [FEATURE] Make deprecation behavior configurable (`:silence`, `:stderror`, `:raise`). See [#248](https://github.com/procore/blueprinter/pull/248) thanks to [@mcclayton](https://github.com/mcclayton).
|
6
|
-
|
7
|
-
## 0.25.1 - 2020/08/18
|
8
|
-
* 🐛 [BUGFIX] Raise Blueprinter::BlueprinterError if Blueprint given is not of class Blueprinter::Base. Before it just raised a generic `undefined method 'prepare'`. See [#233](https://github.com/procore/blueprinter/pull/233) thanks to [@caws](https://github.com/caws).
|
9
|
-
|
10
|
-
## 0.25.0 - 2020/07/06
|
11
|
-
* 🚀 [FEATURE] Enable default `Blueprinter::Transformer`s to be set in the global configuration. [#222](https://github.com/procore/blueprinter/pull/222). Thanks to [@supremebeing7](https://github.com/supremebeing7).
|
12
|
-
|
13
|
-
## 0.24.0 - 2020/06/22
|
14
|
-
* 🚀 [FEATURE] Add an `options` option to associations to facilitate passing options from one blueprint to another. [#220](https://github.com/procore/blueprinter/pull/220). Thanks to [@mcclayton](https://github.com/mcclayton).
|
15
|
-
|
16
|
-
## 0.23.4 - 2020/04/28
|
17
|
-
* 🚀 [FEATURE] Public class method `has_view?` on Blueprinter::Base subclasses introduced in [#213](https://github.com/procore/blueprinter/pull/213). Thanks to [@spencerneste](https://github.com/spencerneste).
|
18
|
-
|
19
|
-
## 0.23.3 - 2020/04/07
|
20
|
-
* 🐛 [BUGFIX] Fixes issue where `exclude` fields in deeply nested views were not respected. Resolved issue [207](https://github.com/procore/blueprinter/issues/207) in [#208](https://github.com/procore/blueprinter/pull/208) by [@tpltn](https://github.com/tpltn).
|
21
|
-
|
22
|
-
## 0.23.2 - 2020/03/16
|
23
|
-
* 🐛 [BUGFIX] Fixes issue where fields "bled" into other views due to merge side-effects. Resolved issue [205](https://github.com/procore/blueprinter/issues/205) in [#204](https://github.com/procore/blueprinter/pull/204) by [@trevorrjohn](https://github.com/trevorrjohn).
|
24
|
-
|
25
|
-
## 0.23.1 - 2020/03/13
|
26
|
-
* 🐛 [BUGFIX] Fixes #172 where views would unintentionally ignore `sort_fields_by: :definition` configuration. Resolved in [#197](https://github.com/procore/blueprinter/pull/197) by [@wlkrw](https://github.com/wlkrw).
|
27
|
-
|
28
|
-
## 0.23.0 - 2020/01/31
|
29
|
-
* 🚀 [FEATURE] Configurable default extractor introduced in [#198](https://github.com/procore/blueprinter/pull/198) by [@wlkrw](https://github.com/wlkrw). You can now set a default extractor like so:
|
30
|
-
```
|
31
|
-
Blueprinter.configure do |config|
|
32
|
-
config.extractor_default = MyAutoExtractor
|
33
|
-
end
|
34
|
-
```
|
35
|
-
|
36
|
-
## 0.22.0 - 2019/12/26
|
37
|
-
* 🚀 [FEATURE] Add rails generators. See `rails g blueprinter:blueprint --help` for usage. Introduced in [#176](https://github.com/procore/blueprinter/pull/176) by [@wlkrw](https://github.com/wlkrw).
|
38
|
-
|
39
|
-
## 0.21.0 - 2019/12/19
|
40
|
-
* 🚀 [FEATURE] Ability to specify `default_if` field/association option for more control on when the default value is applied. [191](https://github.com/procore/blueprinter/pull/191). Thanks to [@mcclayton](https://github.com/mcclayton).
|
41
|
-
|
42
|
-
## 0.20.0 - 2019/10/15
|
43
|
-
* 🚀 [FEATURE] Ability to include multiple views in a single method call with `include_views`. [184](https://github.com/procore/blueprinter/pull/184). Thanks to [@narendranvelmurugan](https://github.com/narendranvelmurugan).
|
44
|
-
|
45
|
-
* 💅 [ENHANCEMENT] Update field-level conditional settings to reflect new three-argument syntax. [183](https://github.com/procore/blueprinter/pull/183). Thanks to [@danirod](https://github.com/danirod).
|
46
|
-
|
47
|
-
* 💅 [ENHANCEMENT] Modify Extractor access control in documentation. [182](https://github.com/procore/blueprinter/pull/182). Thanks to [@cagmz](https://github.com/cagmz).
|
48
|
-
|
49
|
-
* 💅 [ENHANCEMENT] Fix the Transformer example documentation. [174](https://github.com/procore/blueprinter/pull/174). Thanks to [@tjwallace](https://github.com/tjwallace).
|
50
|
-
|
51
|
-
## 0.19.0 - 2019/07/24
|
52
|
-
* 🚀 [FEATURE] Added ability to specify transformers for Blueprinter views to further process the resulting hash before serialization. [#164](https://github.com/procore/blueprinter/pull/164). Thanks to [@amalarayfreshworks](https://github.com/amalarayfreshworks).
|
53
|
-
|
54
|
-
## 0.18.0 - 2019/05/29
|
55
|
-
|
56
|
-
* ⚠️ [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).*
|
57
|
-
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)`.
|
58
|
-
|
59
|
-
## 0.17.0 - 2019/05/23
|
60
|
-
* 🐛 [BUGFIX] Fixing view: :identifier including non-identifier fields. [#154](https://github.com/procore/blueprinter/pull/154). Thanks to [@AllPurposeName](https://github.com/AllPurposeName).
|
61
|
-
|
62
|
-
* 💅 [ENHANCEMENT] Add ability to override :extractor option for an ::association. [#152](https://github.com/procore/blueprinter/pull/152). Thanks to [@hugopeixoto](https://github.com/hugopeixoto).
|
63
|
-
|
64
|
-
## 0.16.0 - 2019/04/03
|
65
|
-
* 🚀 [FEATURE] Add ability to exclude multiple fields inline using `excludes`. [#141](https://github.com/procore/blueprinter/pull/141). Thanks to [@pabhinaya](https://github.com/pabhinaya).
|
66
|
-
|
67
|
-
## 0.15.0 - 2019/04/01
|
68
|
-
* 🚀 [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](https://github.com/procore/blueprinter/pull/145). Thanks to [@mcclayton](https://github.com/mcclayton).
|
69
|
-
|
70
|
-
## 0.14.0 - 2019/04/01
|
71
|
-
* 🚀 [FEATURE] Added a global `datetime_format` option. [#135](https://github.com/procore/blueprinter/pull/143). Thanks to [@ritikesh](https://github.com/ritikesh).
|
72
|
-
|
73
|
-
## 0.13.2 - 2019/03/14
|
74
|
-
* 🐛 [BUGFIX] Replacing use of rails-specific method `Hash::except` so that Blueprinter continues to work in non-Rails environments. [#140](https://github.com/procore/blueprinter/pull/140). Thanks to [@checkbutton](https://github.com/checkbutton).
|
75
|
-
|
76
|
-
## 0.13.1 - 2019/03/02
|
77
|
-
* 💅 [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](https://github.com/procore/blueprinter/pull/139). Thanks to [@ritikesh](https://github.com/ritikesh).
|
78
|
-
|
79
|
-
## 0.13.0 - 2019/02/07
|
80
|
-
|
81
|
-
* 🚀 [FEATURE] Added an option to render with a root key. [#135](https://github.com/procore/blueprinter/pull/135). Thanks to [@ritikesh](https://github.com/ritikesh).
|
82
|
-
* 🚀 [FEATURE] Added an option to render with a top-level meta attribute. [#135](https://github.com/procore/blueprinter/pull/135). Thanks to [@ritikesh](https://github.com/ritikesh).
|
83
|
-
|
84
|
-
## 0.12.1 - 2019/01/24
|
85
|
-
|
86
|
-
* 🐛 [BUGFIX] Fix boolean `false` values getting serialized as `null`. Please see PR [#132](https://github.com/procore/blueprinter/pull/132). Thanks to [@samsongz](https://github.com/samsongz).
|
87
|
-
|
88
|
-
## 0.12.0 - 2019/01/16
|
89
|
-
|
90
|
-
* 🚀 [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](https://github.com/procore/blueprinter/pull/128). Thanks to [@mcclayton](https://github.com/mcclayton).
|
91
|
-
|
92
|
-
## 0.11.0 - 2019/01/15
|
93
|
-
|
94
|
-
* 🚀 [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](https://github.com/procore/blueprinter/pull/127). Thanks to [@mcclayton](https://github.com/mcclayton).
|
95
|
-
|
96
|
-
## 0.10.0 - 2018/12/20
|
97
|
-
|
98
|
-
* 🚀 [FEATURE] Association Blueprints can be dynamically evaluated using a proc. [#122](https://github.com/procore/blueprinter/pull/122). Thanks to [@ritikesh](https://github.com/ritikesh).
|
99
|
-
|
100
|
-
## 0.9.0 - 2018/11/29
|
101
|
-
|
102
|
-
* 🚀 [FEATURE] Added a `render_as_json` API. Similar to `render_as_hash` but returns a JSONified hash. Please see pr [#119](https://github.com/procore/blueprinter/pull/119). Thanks to [@ritikesh](https://github.com/ritikesh).
|
103
|
-
* 🚀 [FEATURE] Sorting of fields in the response is now configurable to sort by definition or by name(asc only). Please see pr [#119](https://github.com/procore/blueprinter/pull/119). Thanks to [@ritikesh](https://github.com/ritikesh).
|
104
|
-
* 💅 [ENHANCEMENT] Updated readme for above features and some existing undocumented features like `exclude fields`, `render_as_hash`. Please see pr [#119](https://github.com/procore/blueprinter/pull/119). Thanks to [@ritikesh](https://github.com/ritikesh).
|
105
|
-
|
106
|
-
## 0.8.0 - 2018/11/19
|
107
|
-
|
108
|
-
* 🚀 [FEATURE] Extend Support for other JSON encoders like yajl-ruby. Please see pr [#118](https://github.com/procore/blueprinter/pull/118). Thanks to [@ritikesh](https://github.com/ritikesh).
|
109
|
-
* 🐛 [BUGFIX] Do not raise error on null date with `date_format` option. Please see pr [#117](https://github.com/procore/blueprinter/pull/117). Thanks to [@tpltn](https://github.com/tpltn).
|
110
|
-
* 🚀 [FEATURE] Add `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](https://github.com/procore/blueprinter/pull/115). Thanks to [@mcclayton](https://github.com/mcclayton).
|
111
|
-
* 🐛 [BUGFIX] Made Base.associations completely private since they are not used outside of the Blueprinter base. Please see pr [#112](https://github.com/procore/blueprinter/pull/112). Thanks to [@philipqnguyen](https://github.com/philipqnguyen).
|
112
|
-
* 🐛 [BUGFIX] Fix issue where entire Blueprinter module was marked api private. Please see pr [#111](https://github.com/procore/blueprinter/pull/111). Thanks to [@philipqnguyen](https://github.com/philipqnguyen).
|
113
|
-
* 🚀 [FEATURE] Allow identifiers to be defined with a block. Please see pr [#110](https://github.com/procore/blueprinter/pull/110). Thanks to [@hugopeixoto](https://github.com/hugopeixoto).
|
114
|
-
* 💅 [ENHANCEMENT] Update docs regarding the args yielded to blocks. Please see pr [#108](https://github.com/procore/blueprinter/pull/108). Thanks to [@philipqnguyen](https://github.com/philipqnguyen).
|
115
|
-
* 💅 [ENHANCEMENT] Use `field` method in fields. Please see pr [#107](https://github.com/procore/blueprinter/pull/107). Thanks to [@hugopeixoto](https://github.com/hugopeixoto).
|
116
|
-
|
117
|
-
## 0.7.0 - 2018/10/17
|
118
|
-
|
119
|
-
* [FEATURE] Allow associations to be defined with a block. Please see pr [#106](https://github.com/procore/blueprinter/pull/106). Thanks to [@hugopeixoto](https://github.com/hugopeixoto).
|
120
|
-
* [FEATURE] Inherit view definition when using inheritance. Please see pr [#105](https://github.com/procore/blueprinter/pull/105). Thanks to [@hugopeixoto](https://github.com/hugopeixoto).
|
121
|
-
|
122
|
-
## 0.6.0 - 2018/06/05
|
123
|
-
|
124
|
-
* 🚀 [FEATURE] Add `date_time` format as an option to `field`. Please see pr #68. Thanks to [@njbbaer](https://github.com/njbbaer).
|
125
|
-
* 🚀 [FEATURE] Add conditional field support `:unless` and `:if` as an option to `field`. Please see pr [#86](https://github.com/procore/blueprinter/pull/86). Thanks to [@ojab](https://github.com/ojab).
|
126
|
-
* 🐛 [BUGFIX] Fix case where miscellaneous options were not being passed through the `AutoExtractor`. See pr [#83](https://github.com/procore/blueprinter/pull/83).
|
127
|
-
|
128
|
-
## 0.5.0 - 2018/05/15
|
129
|
-
|
130
|
-
* 🚀 [FEATURE] Add `default` option to `association` which will be used as the serialized value instead of `null` when the association evaluates to null.
|
131
|
-
See PR [#78](https://github.com/procore/blueprinter/pull/78) by [@vinaya-procore](https://github.com/vinaya-procore).
|
132
|
-
|
133
|
-
## 0.4.0 - 2018/05/02
|
134
|
-
|
135
|
-
* 🚀 [FEATURE] Add `render_as_hash` which will output a hash instead of
|
136
|
-
a JSON String. See PR [#76](https://github.com/procore/blueprinter/pull/76) by [@amayer171](https://github.com/amayer171) and Issue [#73](https://github.com/procore/blueprinter/issues/73).
|
137
|
-
|
138
|
-
## 0.3.0 - 2018/04/05
|
139
|
-
|
140
|
-
💥 [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:
|
141
|
-
|
142
|
-
```
|
143
|
-
field(:first_name, serializer: CustomSerializer)
|
144
|
-
```
|
145
|
-
|
146
|
-
Please rename that to:
|
147
|
-
|
148
|
-
```
|
149
|
-
field(:first_name, extractor: CustomExtractor)
|
150
|
-
```
|
151
|
-
|
152
|
-
* 💅 [ENHANCEMENT] Renamed Serializer classes to Extractor. See #72.
|
153
|
-
* 💅 [ENHANCEMENT] Updated README. See pr [#66](https://github.com/procore/blueprinter/pull/66), [#65](https://github.com/procore/blueprinter/pull/65)
|
154
|
-
|
155
|
-
## 0.2.0 - 2018/01/22
|
156
|
-
|
157
|
-
💥 [BREAKING] Breaking Changes. To upgrade, ensure that any associated objects have a blueprint. For example:
|
158
|
-
```
|
159
|
-
association :comments, blueprint: CommentsBlueprint
|
160
|
-
```
|
161
|
-
|
162
|
-
* 🐛 [BUGFIX] Remove Optimizer class. See [#61](https://github.com/procore/blueprinter/pull/61).
|
163
|
-
* 🐛 [BUGFIX] Require associated objects to have a Blueprint, so that objects will always serialize properly. See [#60](https://github.com/procore/blueprinter/pull/60).
|
164
|
-
|
165
|
-
## 0.1.0 - 2018/01/17
|
166
|
-
|
167
|
-
* 🚀 [FEATURE] Initial release of Blueprinter
|