blueprinter 0.23.2 → 0.23.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/blueprinter/version.rb +1 -1
- data/lib/blueprinter/view_collection.rb +14 -10
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '04947d283f28536a499f609e8e25bb4f4ced350b75756b04dcbeb2de71100dc0'
|
4
|
+
data.tar.gz: ea71156a7134b1378fd829b0b1fd9712ab96b2b7c17d305ef5523e4872424038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18148f52cda6a721e1b4c99d6b3d41d05bad040339d8c175ffd13f18cbd26dbde193541ebc7b42ce5a5cb6e421489741a1b6b780af3009ee850e87192f3edcea
|
7
|
+
data.tar.gz: a1b0a95d9a61be97eaffe45f39bb5347840c8dc8b48e553262e34039f79fced01454b6e867d13a2eb2709ad1f7f21915bd23143d77978404c5b382a914b1532f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.23.3 - 2019/4/7
|
2
|
+
* 🐛 [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).
|
3
|
+
|
1
4
|
## 0.23.2 - 2019/3/16
|
2
5
|
* 🐛 [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).
|
3
6
|
|
data/lib/blueprinter/version.rb
CHANGED
@@ -23,9 +23,10 @@ module Blueprinter
|
|
23
23
|
def fields_for(view_name)
|
24
24
|
return identifier_fields if view_name == :identifier
|
25
25
|
|
26
|
-
|
27
|
-
sorted_fields = sort_by_definition ? sort_by_def(view_name,
|
28
|
-
|
26
|
+
fields, excluded_fields = sortable_fields(view_name)
|
27
|
+
sorted_fields = sort_by_definition ? sort_by_def(view_name, fields) : fields.values.sort_by(&:name)
|
28
|
+
|
29
|
+
(identifier_fields + sorted_fields).reject { |field| excluded_fields.include?(field.name) }
|
29
30
|
end
|
30
31
|
|
31
32
|
def transformers(view_name)
|
@@ -42,20 +43,23 @@ module Blueprinter
|
|
42
43
|
views[:identifier].fields.values
|
43
44
|
end
|
44
45
|
|
46
|
+
# @param [String] view_name
|
47
|
+
# @return [Array<(Hash, Hash<String, NilClass>)>] fields, excluded_fields
|
45
48
|
def sortable_fields(view_name)
|
49
|
+
excluded_fields = {}
|
46
50
|
fields = views[:default].fields
|
47
51
|
fields = merge_fields(fields, views[view_name].fields)
|
48
52
|
views[view_name].included_view_names.each do |included_view_name|
|
49
|
-
if view_name
|
50
|
-
fields = merge_fields(fields, sortable_fields(included_view_name))
|
51
|
-
end
|
52
|
-
end
|
53
|
+
next if view_name == included_view_name
|
53
54
|
|
54
|
-
|
55
|
-
fields
|
55
|
+
view_fields, view_excluded_fields = sortable_fields(included_view_name)
|
56
|
+
fields = merge_fields(fields, view_fields)
|
57
|
+
excluded_fields.merge!(view_excluded_fields)
|
56
58
|
end
|
57
59
|
|
58
|
-
|
60
|
+
views[view_name].excluded_field_names.each { |name| excluded_fields[name] = nil }
|
61
|
+
|
62
|
+
[fields, excluded_fields]
|
59
63
|
end
|
60
64
|
|
61
65
|
# select and order members of fields according to traversal of the definition_orders
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blueprinter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hess
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-04-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: factory_bot
|
@@ -123,6 +123,20 @@ dependencies:
|
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '3.7'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rspec-rails
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "<"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 4.0.0
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "<"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 4.0.0
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: sqlite3
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|