grape-jsonapi-resources 0.0.3 → 0.0.4

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: d724399d91aa89193cf6f8bd2aa712d675026935
4
- data.tar.gz: a5ae6bf9e11338c5bdf0e48508c231c81a1f69c4
3
+ metadata.gz: 58e000f1c8e32f6e080eb2f7585b57d76dfd8b97
4
+ data.tar.gz: 098060f3d2a658ab7659de650643faac924f5232
5
5
  SHA512:
6
- metadata.gz: baf2a59a6dfd2d5f39a36be50e7aeac7fc7c4498168bafc9af12f09902068d43f5fd9eabc0c21d54d92b9e43b6b40fb5a43117f8c4d99d554d1e300b001dad0a
7
- data.tar.gz: 0efef4a40c27f05bfeb7099b176b335a84906206f6e370d635d23f74c78fd23d7c06ca3cb1a96a870413fd2be5c55a1cd8f67d5bf9b9a5729aeba795c9540290
6
+ metadata.gz: d2ed58657a2bfb25229afff893f36cc65188ad7ef9c9ac077ebdf16c0a934c133caa06967d65429762a43f0d0e1c4450f86ce93f28a4c0a14f9e3da5caf7e0c1
7
+ data.tar.gz: 0b6ba3bdef1be2093f85e66c30f23903230290d9eba55870d5bf2b84851adc86b69a3b5d40b87b8e203bf7398bfbdad7efd8bc1c3b13df3f9630245cd417be5a
@@ -18,16 +18,20 @@ module Grape
18
18
 
19
19
  resource_class = resource_class_for(resource)
20
20
 
21
- if resource_class.nil? && resource.blank?
22
- # Return blank object
23
- blank_return = {}
24
- if resource.is_a?(Array)
25
- blank_return[:data] = []
21
+ if resource_class.nil?
22
+ if resource.blank?
23
+ # Return blank object
24
+ blank_return = {}
25
+ if resource.is_a?(Array)
26
+ blank_return[:data] = []
27
+ else
28
+ blank_return[:data] = {}
29
+ end
30
+ blank_return[:meta] = jsonapi_options[:meta] if jsonapi_options[:meta]
31
+ return blank_return.to_json
26
32
  else
27
- blank_return[:data] = {}
33
+ return nil
28
34
  end
29
- blank_return[:meta] = jsonapi_options[:meta] if jsonapi_options[:meta]
30
- return blank_return.to_json
31
35
  end
32
36
 
33
37
  resource_instances = nil
@@ -1,5 +1,5 @@
1
1
  module Grape
2
2
  module JSONAPIResources
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-jsonapi-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cary Dunn