jsonapi-resources 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jsonapi/link_builder.rb +2 -0
- data/lib/jsonapi/resource.rb +1 -1
- data/lib/jsonapi/resource_serializer.rb +1 -0
- data/lib/jsonapi/resources/version.rb +1 -1
- data/lib/jsonapi/routing_ext.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 180872f33ad6e44850227f9cf657698541cfdc495bba54b818f2be82591ffbe4
|
4
|
+
data.tar.gz: e524645c43739882441606fe00d272092177f4b792d6a6f5d4fc09f444eef073
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7048b19d34a04968deee31dd728373abf15c4707ec937544479e68129f0caeb14a7199b2195b9c2944f57887f76d34527e49a3e30a9d1afe2c6739a29ca1c40c
|
7
|
+
data.tar.gz: 2d9c25c7775f7eeae4f73c2129cd60b16e44fe1c419915e02ba30ea0dbda49f60db3f176d640d535544fd5191551d0e7ea49df0ccc44e875659155a7e98abf3d
|
data/lib/jsonapi/link_builder.rb
CHANGED
@@ -150,12 +150,14 @@ module JSONAPI
|
|
150
150
|
|
151
151
|
def related_url_helper_name(relationship)
|
152
152
|
relationship_parts = resource_path_parts_from_class(relationship.parent_resource)
|
153
|
+
relationship_parts << "related"
|
153
154
|
relationship_parts << relationship.name
|
154
155
|
url_helper_name_from_parts(relationship_parts)
|
155
156
|
end
|
156
157
|
|
157
158
|
def singleton_related_url_helper_name(relationship)
|
158
159
|
relationship_parts = []
|
160
|
+
relationship_parts << "related"
|
159
161
|
relationship_parts << relationship.name
|
160
162
|
relationship_parts += resource_path_parts_from_class(relationship.parent_resource)
|
161
163
|
url_helper_name_from_parts(relationship_parts)
|
data/lib/jsonapi/resource.rb
CHANGED
@@ -680,7 +680,7 @@ module JSONAPI
|
|
680
680
|
include_directives = options[:include_directives]
|
681
681
|
if include_directives
|
682
682
|
model_includes = resolve_relationship_names_to_relations(self, include_directives.model_includes, options)
|
683
|
-
records = records.includes(model_includes)
|
683
|
+
records = records.includes(model_includes) if model_includes.present?
|
684
684
|
end
|
685
685
|
|
686
686
|
records
|
data/lib/jsonapi/routing_ext.rb
CHANGED
@@ -235,7 +235,7 @@ module ActionDispatch
|
|
235
235
|
match formatted_relationship_name, controller: options[:controller],
|
236
236
|
relationship: relationship.name, source: resource_type_with_module_prefix(source._type),
|
237
237
|
action: 'get_related_resource', via: [:get],
|
238
|
-
as: relationship_name
|
238
|
+
as: "related/#{relationship_name}"
|
239
239
|
end
|
240
240
|
|
241
241
|
def jsonapi_related_resources(*relationship)
|
@@ -253,7 +253,7 @@ module ActionDispatch
|
|
253
253
|
controller: options[:controller],
|
254
254
|
relationship: relationship.name, source: resource_type_with_module_prefix(source._type),
|
255
255
|
action: 'get_related_resources', via: [:get],
|
256
|
-
as: relationship_name
|
256
|
+
as: "related/#{relationship_name}"
|
257
257
|
end
|
258
258
|
|
259
259
|
protected
|
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.9.
|
4
|
+
version: 0.9.8
|
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: 2019-
|
12
|
+
date: 2019-06-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|