json_api_toolbox 0.5.2 → 0.5.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
  SHA1:
3
- metadata.gz: e0c7f10667361e622bd0f87c0c978705b1fbd0b8
4
- data.tar.gz: ac5f7880a4393f8fb43d64b2bf81c4894f2b3e7a
3
+ metadata.gz: 710c3ff50ec8bf19092d3c77dfc61873879e9c82
4
+ data.tar.gz: dbbefba1e47f36704523c847496cd9c78f7be687
5
5
  SHA512:
6
- metadata.gz: d114ad86a5fc293a427aeb020fd1abcf0ed27b1e6fc71a023d07c1eca636e85ca33c402d11072e0f652632d888a56cb8c434c4a0354394bce3904f07a4305253
7
- data.tar.gz: 051074a8c6b0da03c0c860c269a94e962a7308e746a9f293f3131a6b3c5d6c100146932799fe051667b9d2815c8be7a0d19a82dfbbca306d31eeda6de43a7b30
6
+ metadata.gz: 425af0b5b6f1c0a360516a3942c324767e77040ef0fad696024abcffef60efdaee174fe6b7bb9c92e79d64a70df944a9fc0c0a30c14cad94c41e1e78b508e340
7
+ data.tar.gz: 8b6178f6b286d0f694dd8c6a8e9eb83f63e54904146b690193488bc7123f8b6adf3b8c6746b3fd118de13d678a01174f879ce5e1a01f514d5564e1eff1f3f938
@@ -1,3 +1,3 @@
1
1
  module JsonApiToolbox
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
data/lib/renderizable.rb CHANGED
@@ -13,7 +13,7 @@ module JsonApiToolbox
13
13
  end
14
14
 
15
15
  def render_object(object)
16
- if object.respond_to?(:valid?) && !object.valid?
16
+ if object.respond_to?(:errors) && object.errors.any?
17
17
  render_with_errors(object.errors)
18
18
  else
19
19
  render jsonapi: object, include: includes_params
@@ -38,7 +38,7 @@ module JsonApiToolbox
38
38
 
39
39
  # This line exists to exclude from default_includes_params a relationship
40
40
  # with 'versions' (see gem paper_trail)
41
- model_relationships.delete(:versions)
41
+ model_relationships.delete(:versions)
42
42
 
43
43
  params.merge!(includes: model_relationships)
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_api_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Bacha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-01 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport