jsonapi-resources 0.8.0.beta2 → 0.8.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4b1520ce7f6d1b74c8b973ed7572e618a5b2d56
|
4
|
+
data.tar.gz: f1b2db023f75304968c0496c18034c989e58a043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9081c928a83cc37d2c944fc183171841072bd153d25cb901baf2c368a6d7d97e87016ac22f995231685046ab9edea4d098b55552222efae78cb2bbbe38dc08f8
|
7
|
+
data.tar.gz: 6d57fe3e8b70df7b82cf9095f0f5b15800d6f541d82533f9825b7df22de0aa201bed304861370745e80c4d11f725db4d0ecc529d99e3fb9f6fc29e49b32b81b7
|
data/lib/jsonapi/processor.rb
CHANGED
@@ -141,6 +141,7 @@ module JSONAPI
|
|
141
141
|
source_id = params[:source_id]
|
142
142
|
relationship_type = params[:relationship_type]
|
143
143
|
filters = params[:filters]
|
144
|
+
include_directives = params[:include_directives]
|
144
145
|
sort_criteria = params[:sort_criteria]
|
145
146
|
paginator = params[:paginator]
|
146
147
|
fields = params[:fields]
|
@@ -149,7 +150,8 @@ module JSONAPI
|
|
149
150
|
|
150
151
|
related_resources = source_resource.public_send(relationship_type,
|
151
152
|
context: context,
|
152
|
-
filters:
|
153
|
+
filters: filters,
|
154
|
+
include_directives: include_directives,
|
153
155
|
sort_criteria: sort_criteria,
|
154
156
|
paginator: paginator,
|
155
157
|
fields: fields)
|
@@ -129,7 +129,9 @@ module JSONAPI
|
|
129
129
|
records = resource_klass.apply_filters(records, filters, options)
|
130
130
|
end
|
131
131
|
|
132
|
-
|
132
|
+
records = resource_klass.apply_includes(records, options)
|
133
|
+
|
134
|
+
sort_criteria = options.fetch(:sort_criteria, {})
|
133
135
|
unless sort_criteria.nil? || sort_criteria.empty?
|
134
136
|
order_options = relationship.resource_klass.construct_order_options(sort_criteria)
|
135
137
|
records = resource_klass.apply_sort(records, order_options, @context)
|
@@ -348,7 +348,7 @@ module JSONAPI
|
|
348
348
|
@included_objects[type] = {} unless @included_objects.key?(type)
|
349
349
|
|
350
350
|
if already_serialized?(type, id)
|
351
|
-
@included_objects[type][id][:object_hash].
|
351
|
+
@included_objects[type][id][:object_hash].deep_merge!(object_hash)
|
352
352
|
set_primary(type, id) if primary
|
353
353
|
else
|
354
354
|
@included_objects[type].store(id, primary: primary, object_hash: object_hash)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.0.
|
4
|
+
version: 0.8.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Gebhardt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|