json-pie 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab34b7f1268256832d6e98ca5fb7961696c6fd7263355d84282dda185a0e4744
4
- data.tar.gz: 3131e5fb56bfd504a6eabb34da5c8976227429cec6563e1c7002eff297471cfd
3
+ metadata.gz: 0bedce91be54603fef3199e786dcf0a788a2b7d6b3681a8b7930fccb9d72fbf5
4
+ data.tar.gz: 65e7ad0412287ce4ca5996e2866db9de91a4488d26bd92c039d830371db7bd06
5
5
  SHA512:
6
- metadata.gz: 878597c4caf0040464f44cb9eff1ce193d7ebdeaf00f79b727e981fb2c98d4b9a528e913bf6911560a1a5481686bb7464f1ec2f92be371b7600cc6cc46fe0825
7
- data.tar.gz: c380f9cdbaa22f8fc524e2e17f733d27fbd05d340c8ecc485816b67a575ba113eb4607fc857180ad070d6816ab11e13a8a6259c26158d242fb767b1a692e69bc
6
+ metadata.gz: 1b087ae7f01aab0dbb2378d8e05c83f71e4ab001dea546b6d4e75b34c48ca6547f87da5fd07a524c9698a3f47d393e443ea7e8e9decf9eb689fff262cdd0971f
7
+ data.tar.gz: 4133435d3337cb72d1779fb42614d3370533414452ef98a0880440453289158cd57aa8fb78bc8c93197fb9d7f0903d52ac2b6174e1c87808513f94389f8b1886
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [unreleased]
2
2
 
3
+ ## [0.0.5] - 2022-03-14
4
+
5
+ - Handles nullifying relationships
6
+
3
7
  ## [0.0.4] - 2022-03-03
4
8
 
5
9
  - Imporved public description of the gem
data/Gemfile.lock CHANGED
@@ -1,73 +1,73 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- json-pie (0.0.3)
4
+ json-pie (0.0.4)
5
5
  rails (<= 7.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.0.2.2)
11
- actionpack (= 7.0.2.2)
12
- activesupport (= 7.0.2.2)
10
+ actioncable (7.0.2.3)
11
+ actionpack (= 7.0.2.3)
12
+ activesupport (= 7.0.2.3)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (7.0.2.2)
16
- actionpack (= 7.0.2.2)
17
- activejob (= 7.0.2.2)
18
- activerecord (= 7.0.2.2)
19
- activestorage (= 7.0.2.2)
20
- activesupport (= 7.0.2.2)
15
+ actionmailbox (7.0.2.3)
16
+ actionpack (= 7.0.2.3)
17
+ activejob (= 7.0.2.3)
18
+ activerecord (= 7.0.2.3)
19
+ activestorage (= 7.0.2.3)
20
+ activesupport (= 7.0.2.3)
21
21
  mail (>= 2.7.1)
22
22
  net-imap
23
23
  net-pop
24
24
  net-smtp
25
- actionmailer (7.0.2.2)
26
- actionpack (= 7.0.2.2)
27
- actionview (= 7.0.2.2)
28
- activejob (= 7.0.2.2)
29
- activesupport (= 7.0.2.2)
25
+ actionmailer (7.0.2.3)
26
+ actionpack (= 7.0.2.3)
27
+ actionview (= 7.0.2.3)
28
+ activejob (= 7.0.2.3)
29
+ activesupport (= 7.0.2.3)
30
30
  mail (~> 2.5, >= 2.5.4)
31
31
  net-imap
32
32
  net-pop
33
33
  net-smtp
34
34
  rails-dom-testing (~> 2.0)
35
- actionpack (7.0.2.2)
36
- actionview (= 7.0.2.2)
37
- activesupport (= 7.0.2.2)
35
+ actionpack (7.0.2.3)
36
+ actionview (= 7.0.2.3)
37
+ activesupport (= 7.0.2.3)
38
38
  rack (~> 2.0, >= 2.2.0)
39
39
  rack-test (>= 0.6.3)
40
40
  rails-dom-testing (~> 2.0)
41
41
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
42
- actiontext (7.0.2.2)
43
- actionpack (= 7.0.2.2)
44
- activerecord (= 7.0.2.2)
45
- activestorage (= 7.0.2.2)
46
- activesupport (= 7.0.2.2)
42
+ actiontext (7.0.2.3)
43
+ actionpack (= 7.0.2.3)
44
+ activerecord (= 7.0.2.3)
45
+ activestorage (= 7.0.2.3)
46
+ activesupport (= 7.0.2.3)
47
47
  globalid (>= 0.6.0)
48
48
  nokogiri (>= 1.8.5)
49
- actionview (7.0.2.2)
50
- activesupport (= 7.0.2.2)
49
+ actionview (7.0.2.3)
50
+ activesupport (= 7.0.2.3)
51
51
  builder (~> 3.1)
52
52
  erubi (~> 1.4)
53
53
  rails-dom-testing (~> 2.0)
54
54
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
- activejob (7.0.2.2)
56
- activesupport (= 7.0.2.2)
55
+ activejob (7.0.2.3)
56
+ activesupport (= 7.0.2.3)
57
57
  globalid (>= 0.3.6)
58
- activemodel (7.0.2.2)
59
- activesupport (= 7.0.2.2)
60
- activerecord (7.0.2.2)
61
- activemodel (= 7.0.2.2)
62
- activesupport (= 7.0.2.2)
63
- activestorage (7.0.2.2)
64
- actionpack (= 7.0.2.2)
65
- activejob (= 7.0.2.2)
66
- activerecord (= 7.0.2.2)
67
- activesupport (= 7.0.2.2)
58
+ activemodel (7.0.2.3)
59
+ activesupport (= 7.0.2.3)
60
+ activerecord (7.0.2.3)
61
+ activemodel (= 7.0.2.3)
62
+ activesupport (= 7.0.2.3)
63
+ activestorage (7.0.2.3)
64
+ actionpack (= 7.0.2.3)
65
+ activejob (= 7.0.2.3)
66
+ activerecord (= 7.0.2.3)
67
+ activesupport (= 7.0.2.3)
68
68
  marcel (~> 1.0)
69
69
  mini_mime (>= 1.1.0)
70
- activesupport (7.0.2.2)
70
+ activesupport (7.0.2.3)
71
71
  concurrent-ruby (~> 1.0, >= 1.0.2)
72
72
  i18n (>= 1.6, < 2)
73
73
  minitest (>= 5.1)
@@ -148,28 +148,28 @@ GEM
148
148
  rack (2.2.3)
149
149
  rack-test (1.1.0)
150
150
  rack (>= 1.0, < 3)
151
- rails (7.0.2.2)
152
- actioncable (= 7.0.2.2)
153
- actionmailbox (= 7.0.2.2)
154
- actionmailer (= 7.0.2.2)
155
- actionpack (= 7.0.2.2)
156
- actiontext (= 7.0.2.2)
157
- actionview (= 7.0.2.2)
158
- activejob (= 7.0.2.2)
159
- activemodel (= 7.0.2.2)
160
- activerecord (= 7.0.2.2)
161
- activestorage (= 7.0.2.2)
162
- activesupport (= 7.0.2.2)
151
+ rails (7.0.2.3)
152
+ actioncable (= 7.0.2.3)
153
+ actionmailbox (= 7.0.2.3)
154
+ actionmailer (= 7.0.2.3)
155
+ actionpack (= 7.0.2.3)
156
+ actiontext (= 7.0.2.3)
157
+ actionview (= 7.0.2.3)
158
+ activejob (= 7.0.2.3)
159
+ activemodel (= 7.0.2.3)
160
+ activerecord (= 7.0.2.3)
161
+ activestorage (= 7.0.2.3)
162
+ activesupport (= 7.0.2.3)
163
163
  bundler (>= 1.15.0)
164
- railties (= 7.0.2.2)
164
+ railties (= 7.0.2.3)
165
165
  rails-dom-testing (2.0.3)
166
166
  activesupport (>= 4.2.0)
167
167
  nokogiri (>= 1.6)
168
168
  rails-html-sanitizer (1.4.2)
169
169
  loofah (~> 2.3)
170
- railties (7.0.2.2)
171
- actionpack (= 7.0.2.2)
172
- activesupport (= 7.0.2.2)
170
+ railties (7.0.2.3)
171
+ actionpack (= 7.0.2.3)
172
+ activesupport (= 7.0.2.3)
173
173
  method_source
174
174
  rake (>= 12.2)
175
175
  thor (~> 1.0)
@@ -24,6 +24,8 @@ module JSON
24
24
  end
25
25
 
26
26
  def instance
27
+ return nil if data.blank?
28
+
27
29
  @instance ||= JSON::Pie::ResourceIdentity.find_or_initialize(**data.slice(:id, :type), **options)
28
30
  end
29
31
 
@@ -41,7 +43,7 @@ module JSON
41
43
  end
42
44
 
43
45
  def assign_attributes!
44
- instance.attributes = attributes_tuple.to_h
46
+ instance&.attributes = attributes_tuple.to_h
45
47
  rescue ActiveModel::UnknownAttributeError
46
48
  raise JSON::Pie::InvalidAttribute
47
49
  end
@@ -19,7 +19,7 @@ module JSON
19
19
 
20
20
  def assign
21
21
  relationships.each do |rel, data|
22
- relationship_instance = ResourceObject.parse data.fetch(:data)
22
+ relationship_instance = ResourceObject.parse (data || {}).fetch(:data, {})
23
23
  instance.public_send "#{rel}=", relationship_instance
24
24
  end
25
25
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module JSON
4
4
  module Pie
5
- VERSION = "0.0.4"
5
+ VERSION = "0.0.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json-pie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Kampp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-03 00:00:00.000000000 Z
11
+ date: 2022-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails