jsonapi-realizer 6.2.0 → 6.2.2
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 +4 -2
- data/lib/jsonapi/realizer/resource.rb +2 -4
- 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: 76035465cf3254f1210f6fb47c9fa56774d0a7564456722a1f5f2845399e303b
|
4
|
+
data.tar.gz: a2ca1648916cac59450a0d01fd9d801c65b466d4c4db86e930d74cd966fdc694
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a961ef650cf889f4637a19c9ed606867a9cf45bfabd267df96b846eb576d10ae060e8073f2606f24e4a812c9f67298e37e721c6e2644212b527f651e544aaf
|
7
|
+
data.tar.gz: 9766f382f722a9b18a982c33476940bf960966cb33189b4ddeb6a1c00b6cfdd853e967dbdd6677df673621fbcbe5c7d514904ae1c6bc7d995ea21bda4540dca5
|
@@ -123,18 +123,20 @@ module JSONAPI
|
|
123
123
|
|
124
124
|
private def attributes
|
125
125
|
return unless data
|
126
|
+
return {} unless data["attributes"].kind_of?(Hash)
|
126
127
|
|
127
128
|
data
|
128
|
-
.fetch("attributes"
|
129
|
+
.fetch("attributes")
|
129
130
|
.transform_keys(&:underscore)
|
130
131
|
.select(&resource_class.method(:valid_attribute?))
|
131
132
|
end
|
132
133
|
|
133
134
|
private def relationships
|
134
135
|
return unless data
|
136
|
+
return {} unless data["relationships"].kind_of?(Hash)
|
135
137
|
|
136
138
|
data
|
137
|
-
.fetch("relationships"
|
139
|
+
.fetch("relationships")
|
138
140
|
.transform_keys(&:underscore)
|
139
141
|
.select(&resource_class.method(:valid_relationship?))
|
140
142
|
.transform_values(&method(:as_relationship))
|
@@ -167,8 +167,7 @@ module JSONAPI
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def attributes
|
170
|
-
return unless data.
|
171
|
-
|
170
|
+
return {} unless data["attributes"].kind_of?(Hash)
|
172
171
|
@attributes ||= data
|
173
172
|
.fetch("attributes")
|
174
173
|
.transform_keys(&:underscore)
|
@@ -176,8 +175,7 @@ module JSONAPI
|
|
176
175
|
end
|
177
176
|
|
178
177
|
def relationships
|
179
|
-
return unless data.
|
180
|
-
|
178
|
+
return {} unless data["relationships"].kind_of?(Hash)
|
181
179
|
@relationships ||= data
|
182
180
|
.fetch("relationships")
|
183
181
|
.transform_keys(&:underscore)
|
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.2
|
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-
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|