zuora_connect_ui 0.11.5 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{LICENSE.txt → LICENSE} +0 -0
- data/Rakefile +6 -0
- data/config/initializers/oj.rb +4 -0
- data/lib/zuora_connect_ui/serializer.rb +11 -6
- data/lib/zuora_connect_ui/serializer/relationship.rb +7 -3
- data/lib/zuora_connect_ui/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 61cb67a239da8e4227096a1dd8cb4310fef64934a3278580d86c3c7913725084
|
|
4
|
+
data.tar.gz: 4d694680f26a6b83b08e18abdb77e63ae30166e9ba9dc517e7a729a362941bb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c7f98347b0013e84c2246f2bf46ac9592520ad4bf7308ddaa4f983dd1dd2d07e4e473f4fdc9e8908ce03f7c4ed457b2109a186bca2eba4b82d716f7856ab11e
|
|
7
|
+
data.tar.gz: 433f3fa7deaa995b2416bd76b0ebfd6606a4087708fade38ec86a28e893e25271a4c937a53c2ca142961091569848a0a73b5eab4815be660bad6730245426145
|
data/{LICENSE.txt → LICENSE}
RENAMED
|
File without changes
|
data/Rakefile
ADDED
|
@@ -52,10 +52,10 @@ module ZuoraConnectUi
|
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def hash_for_collection
|
|
55
|
-
hash = { data: {} }
|
|
55
|
+
hash = { data: { items: [] } }
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
items << record_hash(resource, @record_type)
|
|
57
|
+
@resource.each do |resource|
|
|
58
|
+
hash[:data][:items] << record_hash(resource, @record_type)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
return hash if @associations.empty?
|
|
@@ -86,16 +86,21 @@ module ZuoraConnectUi
|
|
|
86
86
|
end
|
|
87
87
|
@associations.each do |association|
|
|
88
88
|
field = association.id_method_name
|
|
89
|
-
|
|
89
|
+
camel_key = @cache_keys[field] ||= key_transform(field)
|
|
90
|
+
hash[camel_key] = resource.public_send(field)
|
|
90
91
|
end
|
|
91
92
|
hash
|
|
92
93
|
end
|
|
93
94
|
|
|
94
95
|
def get_associations(resource)
|
|
95
|
-
|
|
96
|
+
associations = {}
|
|
97
|
+
|
|
98
|
+
@associations.each do |a|
|
|
96
99
|
hash_key = key_transform(a.plural_type)
|
|
97
|
-
|
|
100
|
+
associations[hash_key] = a.serialize(resource, @fields[a.record_type])
|
|
98
101
|
end
|
|
102
|
+
|
|
103
|
+
associations
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
def parse_fields(fields)
|
|
@@ -17,7 +17,9 @@ module ZuoraConnectUi
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def serialize(resources, fields)
|
|
20
|
-
|
|
20
|
+
relationship_hash = {}
|
|
21
|
+
|
|
22
|
+
resources.each do |resource|
|
|
21
23
|
relations = resource.public_send(key)
|
|
22
24
|
|
|
23
25
|
next if relations.nil?
|
|
@@ -25,11 +27,13 @@ module ZuoraConnectUi
|
|
|
25
27
|
relations = [relations] unless @relationship_type == :has_many
|
|
26
28
|
|
|
27
29
|
relations.each do |relation|
|
|
28
|
-
next if
|
|
30
|
+
next if relationship_hash.key? relation.id
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
relationship_hash[relation.id] = record_hash(relation, fields)
|
|
31
33
|
end
|
|
32
34
|
end
|
|
35
|
+
|
|
36
|
+
relationship_hash
|
|
33
37
|
end
|
|
34
38
|
|
|
35
39
|
private
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zuora_connect_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.11.
|
|
4
|
+
version: 0.11.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Connect Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-11-
|
|
11
|
+
date: 2020-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -283,8 +283,9 @@ executables: []
|
|
|
283
283
|
extensions: []
|
|
284
284
|
extra_rdoc_files: []
|
|
285
285
|
files:
|
|
286
|
-
- LICENSE
|
|
286
|
+
- LICENSE
|
|
287
287
|
- README.md
|
|
288
|
+
- Rakefile
|
|
288
289
|
- app/assets/javascripts/zuora_connect_ui.js
|
|
289
290
|
- app/assets/javascripts/zuora_connect_ui/app.js.erb
|
|
290
291
|
- app/assets/javascripts/zuora_connect_ui/bundle/connect-ui.min.js
|
|
@@ -314,6 +315,7 @@ files:
|
|
|
314
315
|
- app/views/partials/_row_actions.html.erb
|
|
315
316
|
- app/views/partials/_table.html.erb
|
|
316
317
|
- app/views/peek/views/_connect.html.erb
|
|
318
|
+
- config/initializers/oj.rb
|
|
317
319
|
- lib/peek/views/connect.rb
|
|
318
320
|
- lib/zuora_connect_ui.rb
|
|
319
321
|
- lib/zuora_connect_ui/serializer.rb
|