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: d9773e11d98a5ff7baeb184627737a96e541de98
4
- data.tar.gz: a1a9417f8aa7ff48e9f093ee62f6501552d5418d
3
+ metadata.gz: 994dbbd65ed5c9b5d65b3addc2bf880dbdd0b102
4
+ data.tar.gz: 9cb8b76e4f5f2105f79239a3c5493957b13511e4
5
5
  SHA512:
6
- metadata.gz: 5e51a01324b0475819785e26823ba0c958982a6a86a97386d4f93862fcdf98e9d0448cc3041e675eb4c29bae107ebaaee775d629eeb734d2ce3448cd4e033fdb
7
- data.tar.gz: e2f191527644e59f161574e4bb232696dad12ecb7d03645fa9b35157b7063ad8d9bb8f04daf5bbe8c7470c3a09b5a156e18729e8a1c1dd2d130a6f72e8cd69ba
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
- replace_to_one_relationship(source_record, records, relation_name)
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
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Authorization
3
- VERSION = "1.0.0.alpha3".freeze
3
+ VERSION = "1.0.0.alpha4".freeze
4
4
  end
5
5
  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.alpha3
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-22 00:00:00.000000000 Z
12
+ date: 2017-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-resources