abc_jsonapi 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: f930de70d9fa7967f92ce01a75603086b7c7452115c00960753c687add337dda
4
- data.tar.gz: b807f6ce9a7247d9add59c128054f852c969293638f8e952c961cb57fbd71435
3
+ metadata.gz: ef48038b2ba006ddb0fe1b53cb96e3623240b7357eb945de3c1ea3b461cfc5ae
4
+ data.tar.gz: e0011ed1501305346f0ca1291da2383f21ffa6665f0e7d30544939584c76dedd
5
5
  SHA512:
6
- metadata.gz: ff3689062fb7f110442e9a94ceeda3dd8755b4ea2f838db155d4e1752d97adb85b2f0cd9791193519642158148ac754b579c736da05cabfb46e9c2d811424ab2
7
- data.tar.gz: 1eb4f4ff0c4b47d5c0682df1b5a917d687e0f7e172de4f1e91e40d5a9bc1ea2daef9764d2c1cdfe6e6811986857bb764270305d1fe22b09ea4523cb3fb78c053
6
+ metadata.gz: 58e68cc41d35c51b09d6076c8d89151f0441df314acacc76bc1516c07073f0436b5e7f7adc30bd76823e7ec5dbd6810b84e495053c35754621e238525f14b339
7
+ data.tar.gz: 1e8d1c9564221c3c49cb559274734b73fe4a796af50918726c5abb75b20779fe54b111d89933a35a19cb667a7e02f3d06e4a6e4ffc4db8c475233428eab7ba68
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abc_jsonapi (0.2.2)
4
+ abc_jsonapi (0.2.3)
5
5
  activesupport (>= 5.2)
6
6
  i18n
7
7
 
@@ -27,11 +27,13 @@ module AbcJsonapi
27
27
  @resource_attributes = self.class.resource_attributes
28
28
  @relationships = self.class.relationships
29
29
  @virtual_attributes = self.class.virtual_attributes
30
- @includes = options[:include] if options[:include].present?
31
- @meta = options[:meta] if options[:meta].present?
30
+ @includes = options[:include]
31
+ @meta = options[:meta]
32
32
  end
33
33
 
34
34
  def serializable_hash
35
+ return nil if resource.nil?
36
+
35
37
  result_hash[:meta] = meta if meta.present?
36
38
  result_hash[:data] = data_hash
37
39
  result_hash[:included] = included_hash if @includes.present?
@@ -1,3 +1,3 @@
1
1
  module AbcJsonapi
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abc_jsonapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zhmakin Evgeniy