graphiti 1.2.38 → 1.2.39

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: c269e7e8afb7836e7d20aa4d8f837f10ef8576356da1d8c76b93b40bc630a97c
4
- data.tar.gz: 29ffb9ec585198d92ab8cb75f23562f96ad8f82115301844b389374cbc94cd67
3
+ metadata.gz: 6d2917a607d95ef6d4701b8960ed183fd39923662b034d74fda9f8080f65d534
4
+ data.tar.gz: 7fc8ec33363e0112c541d05c676c7315b1934876f15875ac0b153bf2fc6cebdd
5
5
  SHA512:
6
- metadata.gz: a5cfe7c03f2a66e3f874902030e56aed8561ed81b4dd5bca849bee82b902d908f4faa32131842220fa1b010b9c2b2276b9158a852e2cf58ddf6f4b5118769dd1
7
- data.tar.gz: 39b5ffbfa860fcdf1601c2f718c75d401bb2851a1c1c496f5930a81d64329845bba0d4fa7312128d8da25bfe07624fc2be777ccaf768257ae4d6d0291d6796d8
6
+ metadata.gz: 6f9867cbf49483cb09a887db26af222e2d74962c07aaf6ece7552a73cf74b625ca49e19ed730c1f383f7706ae10546551d54792b2b09832709aa14829ddd8180
7
+ data.tar.gz: 746d7900a12437a7a610dc8d4e8737ada319867578349898cc95067d7295c1b04b659dec00e33aec0a9977c33ecafd0a58f9f07da61ec04def6ad8131656351f
@@ -25,7 +25,7 @@ module Graphiti
25
25
  end
26
26
  end
27
27
 
28
- typecast_attributes(resource, deserialized_payload.attributes, deserialized_payload.meta[:payload_path])
28
+ typecast_attributes(resource, deserialized_payload.attributes, @action, deserialized_payload.meta[:payload_path])
29
29
  process_relationships(resource, deserialized_payload.relationships, deserialized_payload.meta[:payload_path])
30
30
  else
31
31
  errors.add(:"data.type", :missing)
@@ -65,15 +65,20 @@ module Graphiti
65
65
  next
66
66
  end
67
67
 
68
- typecast_attributes(x[:resource], x[:attributes], x[:meta][:payload_path])
69
- process_relationships(x[:resource], x[:relationships], x[:meta][:payload_path])
68
+ resource = x[:resource]
69
+ attributes = x[:attributes]
70
+ relationships = x[:relationships]
71
+ payload_path = x[:meta][:payload_path]
72
+ action = x[:meta][:method]
73
+ typecast_attributes(resource, attributes, action, payload_path)
74
+ process_relationships(resource, relationships, payload_path)
70
75
  end
71
76
  end
72
77
 
73
- def typecast_attributes(resource, attributes, payload_path)
78
+ def typecast_attributes(resource, attributes, action, payload_path)
74
79
  attributes.each_pair do |key, value|
75
80
  # Only validate id if create action, otherwise it's only used for lookup
76
- next if @action != :create &&
81
+ next if action != :create &&
77
82
  key == :id &&
78
83
  resource.class.config[:attributes][:id][:writable] == false
79
84
 
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.2.38"
2
+ VERSION = "1.2.39"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.38
4
+ version: 1.2.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-21 00:00:00.000000000 Z
11
+ date: 2021-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable