jsonapi-authorization 1.0.0.alpha3 β 1.0.0.alpha4
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: 994dbbd65ed5c9b5d65b3addc2bf880dbdd0b102
|
4
|
+
data.tar.gz: 9cb8b76e4f5f2105f79239a3c5493957b13511e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6230923d4150aa1a207f64ca473f3cf147644729c8449a353bbdd9b85b2db319232388bec7ba7f57c379311cea0c8a0c5cd3b8bd4aa4ab438525ffbd6e7d20a
|
7
|
+
data.tar.gz: 63ea830d6a7a9b6a635f493027a2f2ce2441e79b77c39869b5175598b461ae7370f4e0bc280e0666fd55a275a96a92c09ccff40eaf55b4f6af905e10b9f5c630
|
data/.all-contributorsrc
CHANGED
@@ -104,6 +104,17 @@
|
|
104
104
|
"code",
|
105
105
|
"test"
|
106
106
|
]
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"login": "jpalumickas",
|
110
|
+
"name": "Justas Palumickas",
|
111
|
+
"avatar_url": "https://avatars0.githubusercontent.com/u/2738630?v=3",
|
112
|
+
"profile": "https://jpalumickas.com",
|
113
|
+
"contributions": [
|
114
|
+
"bug",
|
115
|
+
"code",
|
116
|
+
"test"
|
117
|
+
]
|
107
118
|
}
|
108
119
|
]
|
109
120
|
}
|
data/README.md
CHANGED
@@ -179,7 +179,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
179
179
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
180
180
|
| [<img src="https://avatars.githubusercontent.com/u/482561?v=3" width="100px;"/><br /><sub>Vesa Laakso</sub>](http://vesalaakso.com)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=valscion) [π](https://github.com/Venuu/jsonapi-authorization/commits?author=valscion) π [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=valscion) [π](https://github.com/Venuu/jsonapi-authorization/issues?q=author%3Avalscion) π¬ π | [<img src="https://avatars.githubusercontent.com/u/562204?v=3" width="100px;"/><br /><sub>Emil SΓ₯gfors</sub>](https://github.com/lime)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=lime) [π](https://github.com/Venuu/jsonapi-authorization/commits?author=lime) π [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=lime) [π](https://github.com/Venuu/jsonapi-authorization/issues?q=author%3Alime) π¬ π | [<img src="https://avatars.githubusercontent.com/u/1591161?v=3" width="100px;"/><br /><sub>Matthias Grundmann</sub>](https://github.com/matthias-g)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=matthias-g) [π](https://github.com/Venuu/jsonapi-authorization/commits?author=matthias-g) [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=matthias-g) π¬ | [<img src="https://avatars.githubusercontent.com/u/1322?v=3" width="100px;"/><br /><sub>Thibaud Guillaume-Gentil</sub>](http://thibaud.gg)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=thibaudgg) | [<img src="https://avatars.githubusercontent.com/u/71660?v=3" width="100px;"/><br /><sub>Daniel SchweighΓΆfer</sub>](http://netsteward.net)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=acid) | [<img src="https://avatars.githubusercontent.com/u/5076967?v=3" width="100px;"/><br /><sub>Bruno Sofiato</sub>](https://github.com/bsofiato)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=bsofiato) | [<img src="https://avatars.githubusercontent.com/u/1896026?v=3" width="100px;"/><br /><sub>Adam Robertson</sub>](https://github.com/arcreative)<br />[π](https://github.com/Venuu/jsonapi-authorization/commits?author=arcreative) |
|
181
181
|
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
182
|
-
| [<img src="https://avatars3.githubusercontent.com/u/4742306?v=3" width="100px;"/><br /><sub>Greg Fisher</sub>](https://github.com/gnfisher)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=gnfisher) [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=gnfisher) | [<img src="https://avatars3.githubusercontent.com/u/370182?v=3" width="100px;"/><br /><sub>Sam</sub>](http://samlh.com)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=handlers) [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=handlers) |
|
182
|
+
| [<img src="https://avatars3.githubusercontent.com/u/4742306?v=3" width="100px;"/><br /><sub>Greg Fisher</sub>](https://github.com/gnfisher)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=gnfisher) [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=gnfisher) | [<img src="https://avatars3.githubusercontent.com/u/370182?v=3" width="100px;"/><br /><sub>Sam</sub>](http://samlh.com)<br />[π»](https://github.com/Venuu/jsonapi-authorization/commits?author=handlers) [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=handlers) | [<img src="https://avatars0.githubusercontent.com/u/2738630?v=3" width="100px;"/><br /><sub>Justas Palumickas</sub>](https://jpalumickas.com)<br />[π](https://github.com/Venuu/jsonapi-authorization/issues?q=author%3Ajpalumickas) [π»](https://github.com/Venuu/jsonapi-authorization/commits?author=jpalumickas) [β οΈ](https://github.com/Venuu/jsonapi-authorization/commits?author=jpalumickas) |
|
183
183
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
184
184
|
|
185
185
|
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
@@ -269,6 +269,8 @@ module JSONAPI
|
|
269
269
|
data[rel_type].flat_map do |assoc_name, assoc_value|
|
270
270
|
related_models =
|
271
271
|
case assoc_value
|
272
|
+
when nil
|
273
|
+
nil
|
272
274
|
when Hash # polymorphic relationship
|
273
275
|
resource_class = @resource_klass.resource_for(assoc_value[:type].to_s)
|
274
276
|
resource_class.find_by_key(assoc_value[:id], context: context)._model
|
@@ -260,7 +260,11 @@ module JSONAPI
|
|
260
260
|
when :to_many
|
261
261
|
replace_to_many_relationship(source_record, records, relation_name)
|
262
262
|
when :to_one
|
263
|
-
|
263
|
+
if records.nil?
|
264
|
+
remove_to_one_relationship(source_record, relation_name)
|
265
|
+
else
|
266
|
+
replace_to_one_relationship(source_record, records, relation_name)
|
267
|
+
end
|
264
268
|
end
|
265
269
|
end
|
266
270
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.alpha4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vesa Laakso
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-05-
|
12
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jsonapi-resources
|