jsonapi_compliable 0.11.5 → 0.11.6

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: fc2ca5a3781405bc32a96e5c3b4eaec16191c5cf
4
- data.tar.gz: 3d27bc6e53dd40faa3097c5b9a86bb7c52b58a3f
3
+ metadata.gz: b7d9f768e68387c9ad4d1631a0e9ca9fb962a944
4
+ data.tar.gz: 3d04f2113cb2a752ed7e5d9ff20e12aa883a7e68
5
5
  SHA512:
6
- metadata.gz: bc1e4b62b63fc12c1b47fbda2dad76c342d59b56cf8a811a9a6c1b1b28a186443676c668ab8df62f45ec9b75d8cdf12a2ed74d4ca1916514caac0090f6976cf0
7
- data.tar.gz: 1cd3d205a104c17959f65cbbbb7e208ce056f41c72535a2c4e478f0abb751b0d016e7c3610b97e9150918ba7d4f1d96aaa2b27c8c49ddfa2809db39d659fd6ed
6
+ metadata.gz: 21be2e3895bdc99f2d9be9dafa6683b5a0b17a0cd5b443b0e249633fe58737d87c2b16789cad33757048d1b5401d650296d91f185758192c74c67705ef69b919
7
+ data.tar.gz: 2c8bf62f1b65ebca3e1ac64faebc917acc5f66d3f7ade5cebad9a79e3fa5181e9530e321cd176ffcb5b903558c9bb0f572eee526293815b39cc808f9ffe0f1f1
@@ -12,15 +12,22 @@ module JsonapiCompliable
12
12
  h[k] = [*names, "Serializable#{klass}"].join('::').safe_constantize
13
13
  end
14
14
 
15
+ fields = query_hash[:fields].dup
16
+ extra_fields = query_hash[:extra_fields]
17
+
18
+ if extra_fields.any? && fields.any?
19
+ extra_fields.each { |k,v| fields[k] = fields[k].to_a + v }
20
+ end
21
+
15
22
  options = {}
16
23
  options[:class] = inferrer
17
24
  options[:include] = query_hash[:include]
18
25
  options[:jsonapi] = resolved
19
- options[:fields] = query_hash[:fields]
26
+ options[:fields] = fields
20
27
  options.merge!(overrides)
21
28
  options[:meta] ||= {}
22
29
  options[:expose] ||= {}
23
- options[:expose][:extra_fields] = query_hash[:extra_fields]
30
+ options[:expose][:extra_fields] = extra_fields
24
31
 
25
32
  if object.respond_to?(:resolve_stats)
26
33
  stats = object.resolve_stats
@@ -1,3 +1,3 @@
1
1
  module JsonapiCompliable
2
- VERSION = "0.11.5"
2
+ VERSION = "0.11.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_compliable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.5
4
+ version: 0.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-05-03 00:00:00.000000000 Z
12
+ date: 2018-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-serializable