jsonapi-realizer 6.2.3 → 6.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jsonapi/realizer/action.rb +2 -2
- data/lib/jsonapi/realizer/resource.rb +2 -2
- data/lib/jsonapi/realizer/version.rb +1 -1
- 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: 33ccbc88f14ef738c2dbb2e5c2045bd3a74109d699bd3e0d9706455d2fa71f31
|
4
|
+
data.tar.gz: 39822d29321c8f54440c5be6f4f140a3fb13e13e24ae4a3a90d3f07a04402371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 177c312e93401ba515e396516e0cc41d883f4fed36858ff6a30d23ee4bdef157fe750e3aa079f0523b6a64578c4d10fc13a9403149740d7bb2f12c8b3b81400d
|
7
|
+
data.tar.gz: b7c225733a3cb9f11f97443b1f18e25458f24789e4c64526cdd9cf6f38be2aeab1d8748174aaed2ccdaaadf9e9de91cfe9d47d38985c4ac123c50acbb9d2a46a
|
@@ -123,7 +123,7 @@ module JSONAPI
|
|
123
123
|
|
124
124
|
private def attributes
|
125
125
|
return unless data
|
126
|
-
return {} unless data["attributes"].
|
126
|
+
return {} unless data["attributes"].is_a?(Hash)
|
127
127
|
|
128
128
|
data
|
129
129
|
.fetch("attributes")
|
@@ -133,7 +133,7 @@ module JSONAPI
|
|
133
133
|
|
134
134
|
private def relationships
|
135
135
|
return unless data
|
136
|
-
return {} unless data["relationships"].
|
136
|
+
return {} unless data["relationships"].is_a?(Hash)
|
137
137
|
|
138
138
|
data
|
139
139
|
.fetch("relationships")
|
@@ -126,7 +126,7 @@ module JSONAPI
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def include?
|
129
|
-
parameters.key?("include") && parameters.fetch("include").respond_to?(:split)
|
129
|
+
parameters.key?("include") && parameters.fetch("include").respond_to?(:split) && parameters.fetch("include").split(/\s*,\s*/).any?
|
130
130
|
end
|
131
131
|
|
132
132
|
def includes
|
@@ -321,7 +321,7 @@ module JSONAPI
|
|
321
321
|
|
322
322
|
relation_configuration = relation(name).realizer_class.configuration
|
323
323
|
|
324
|
-
if data.
|
324
|
+
if data.is_a?(Array)
|
325
325
|
[name, relation_configuration.adapter.find_many(relation_configuration.model_class, { id: data.map { |value| value.fetch("id") } })]
|
326
326
|
else
|
327
327
|
[name, relation_configuration.adapter.find_one(relation_configuration.model_class, data.fetch("id"))]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-realizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurtis Rainbolt-Greene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|