graphiti 1.2.37 → 1.2.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/util/serializer_attributes.rb +12 -6
- data/lib/graphiti/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c269e7e8afb7836e7d20aa4d8f837f10ef8576356da1d8c76b93b40bc630a97c
|
4
|
+
data.tar.gz: 29ffb9ec585198d92ab8cb75f23562f96ad8f82115301844b389374cbc94cd67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5cfe7c03f2a66e3f874902030e56aed8561ed81b4dd5bca849bee82b902d908f4faa32131842220fa1b010b9c2b2276b9158a852e2cf58ddf6f4b5118769dd1
|
7
|
+
data.tar.gz: 39b5ffbfa860fcdf1601c2f718c75d401bb2851a1c1c496f5930a81d64329845bba0d4fa7312128d8da25bfe07624fc2be777ccaf768257ae4d6d0291d6796d8
|
@@ -16,13 +16,11 @@ module Graphiti
|
|
16
16
|
|
17
17
|
if @name == :id
|
18
18
|
@serializer.id(&proc)
|
19
|
-
elsif @attr[:proc]
|
19
|
+
elsif @attr[:proc] ||
|
20
|
+
!previously_applied? ||
|
21
|
+
previously_applied_via_resource?
|
20
22
|
@serializer.send(_method, @name, serializer_options, &proc)
|
21
|
-
|
22
|
-
@serializer.send(_method, @name, serializer_options, &proc)
|
23
|
-
elsif @serializer.send(applied_method).include?(@name)
|
24
|
-
@serializer.field_condition_blocks[@name] = guard if guard?
|
25
|
-
else
|
23
|
+
else # Previously applied via explicit serializer, so wrap it
|
26
24
|
inner = @serializer.attribute_blocks.delete(@name)
|
27
25
|
wrapped = wrap_proc(inner)
|
28
26
|
@serializer.send(_method, @name, serializer_options, &wrapped)
|
@@ -34,6 +32,14 @@ module Graphiti
|
|
34
32
|
|
35
33
|
private
|
36
34
|
|
35
|
+
def previously_applied?
|
36
|
+
@serializer.attribute_blocks[@name].present?
|
37
|
+
end
|
38
|
+
|
39
|
+
def previously_applied_via_resource?
|
40
|
+
@serializer.send(applied_method).include?(@name)
|
41
|
+
end
|
42
|
+
|
37
43
|
def previously_guarded?
|
38
44
|
@serializer.field_condition_blocks[@name]
|
39
45
|
end
|
data/lib/graphiti/version.rb
CHANGED
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.
|
4
|
+
version: 1.2.38
|
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-
|
11
|
+
date: 2021-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|