json_api_toolbox 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93a2045c2294932efa199ba493e039f17f050ad9
4
- data.tar.gz: e8ed8912207f37a2620eeb69c19f7da2aec2ed9b
3
+ metadata.gz: 2d33816c28038995cf4e2224903f03411e9549a1
4
+ data.tar.gz: 91203e54fa5e9d19e60b9873a4db25b0725840e7
5
5
  SHA512:
6
- metadata.gz: 11676fb0e857a27e12fc7e2fb402854d4234cea07238f13a90efd4451630b0a649620e37dcdfccc209716895c1fa17175697188ec1cacc08d31bd3dc1bfa00e7
7
- data.tar.gz: 72cc4f6c03ee1466481498840311c4775589d1029047ad85c2fe7e5f096e8477796490b6975ea453271ca459daf1189cdc10237a0e11c538da258cd00d982848
6
+ metadata.gz: e08c1c7e13b148b2c9eb0176ed0e41e8f25e3ace7551b50df6fca3c3f4ad73413cf678839e38c3fc7b95c6716d23b541ae9b320fab509c37299dd72c97c3c7d3
7
+ data.tar.gz: d59ead9e3b2de9cc8cd087344fccdf8fa4f797747e584d03c2d759e5e8c92ad782656b2a1c4ffacfd888056f0ba2ed250ed7b46530f8f435b7e061df84ba7ebe
data/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.16.0] - 2018-08-14
10
+ ### Fixed
11
+ - Added method `.put` to JsonApiToolbox::Service
12
+
13
+ ## [0.15.1] - 2018-07-02
14
+ ### Fixed
15
+ - Fixed headers Content-Type in post method at JsonApiToolbox::Service
16
+
9
17
  ## [0.15.0] - 2018-06-15
10
18
  ### Added
11
19
  - Added method `.patch` to JsonApiToolbox::Service
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonApiToolbox
4
- VERSION = '0.15.0'
4
+ VERSION = '0.16.0'
5
5
  end
data/lib/postable.rb CHANGED
@@ -14,7 +14,7 @@ module JsonApiToolbox
14
14
  Hash[normalized_hash]
15
15
  end
16
16
 
17
- private_class_method
17
+ private
18
18
 
19
19
  def association_class(model, key)
20
20
  association = model.reflect_on_all_associations.find do |association_i|
data/lib/service.rb CHANGED
@@ -32,7 +32,10 @@ module JsonApiToolbox
32
32
  end
33
33
 
34
34
  def build_header
35
- headers = { Authorization: RequestStore.store[:token] }
35
+ headers = {
36
+ 'Authorization' => RequestStore.store[:token],
37
+ 'Content-Type' => 'application/json'
38
+ }
36
39
  headers[:params] = body if method == :get
37
40
  headers
38
41
  end
@@ -55,6 +58,10 @@ module JsonApiToolbox
55
58
  new(:patch, url, body).execute
56
59
  end
57
60
 
61
+ def put(url: nil, body: nil)
62
+ new(:put, url, body).execute
63
+ end
64
+
58
65
  def parse_response(response)
59
66
  response_parsed = JSON::Api::Vanilla.parse(response.body)
60
67
  response_parsed.data || response_parsed.errors
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.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Bacha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-21 00:00:00.000000000 Z
11
+ date: 2018-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack