strong_resources 0.6.1 → 0.6.2

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: 2a4a332453910364583052d1d3c11813d93cab39
4
- data.tar.gz: dc6e98e4fc2432ac37018e2153a793c532cea850
3
+ metadata.gz: dfbf549ffd25b301a302af319a73cd1348dffe74
4
+ data.tar.gz: 4c836489bb12cdb8d6dbfecc24f41a6af50b40c9
5
5
  SHA512:
6
- metadata.gz: 222e0a9343cc0af2e4e7f1b81884d1ae77509cb916b9fa70fd0a14bf503aad3e639ce8b17b81e20701b6e1d4c84830e67d8b101d1b135dba58498867d8f54100
7
- data.tar.gz: 0442f5af9735888b763f5183b49b30db5e98f3af10ffd35c3bca7825920e9091c5ee000e25896d73f41490ec93fa5dc3d7a8aa11fe8e93ac4c9241714174d340
6
+ metadata.gz: 466e256966eb924f8f0bf95ba87f25c262f51dbbf8672644b94c413b1c89db1c57584cbcf268dd35dd00524df03c4fe1c91655dab1db215f519cbfe353f63ad5
7
+ data.tar.gz: 345d82757d32e9b30e7fda0e9ab1149c89302653a8a626967979447740ddc13ccad77d4a8ddda7a6b7859cb78fab7f5e608b233664e60a66d5e9820a08e06c4c
@@ -20,8 +20,12 @@ module StrongResources
20
20
  deserializer.attributes = deserializer.attributes.permit(strong_resource)
21
21
 
22
22
  deserializer.relationships.each_pair do |name, relationship_payload|
23
- [relationship_payload].flatten.each do |rp|
24
- apply_strong_param(rp, strong_resource[:relationships][name])
23
+ if strong_resource[:relationships].has_key?(name)
24
+ [relationship_payload].flatten.each do |rp|
25
+ apply_strong_param(rp, strong_resource[:relationships][name])
26
+ end
27
+ else
28
+ deserializer.relationships.delete(name)
25
29
  end
26
30
  end
27
31
  end
@@ -49,6 +49,10 @@ module StrongResources
49
49
  self.attributes.delete(name)
50
50
  end
51
51
 
52
+ def remove_relationship(name)
53
+ self.relations.delete(name)
54
+ end
55
+
52
56
  def on(action_name, &blk)
53
57
  self.customized_actions[action_name] = blk
54
58
  end
@@ -1,3 +1,3 @@
1
1
  module StrongResources
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi_compliable