jsonapi-utils 0.5.2 → 0.6.0.beta

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: 95cb09b9a0147e9a991c8ac9b07cea55092560ab
4
- data.tar.gz: a26c53529ce6737659dd75a1ae5f70f223317522
3
+ metadata.gz: 53c3ddcb7fbfb8b20eb1bb345d044a99b8e88c48
4
+ data.tar.gz: 6cf60b61e4d16acdbb22165a38c603809ae47689
5
5
  SHA512:
6
- metadata.gz: 90bfc9584d1bca838113bd148dafff85cd31507f22b17279e87c544eed151a2ce68eaa2cbede848df4e95c0aa292cec590df7118ea5847a2f608891eb87483d2
7
- data.tar.gz: ae340b7a231721a3505c67a8146bcaae2c03ba2a33a04dfa203f199f2839e49e6bffb826e314b83b782bb768947921e9675ba2d7ca5019d3e66c8551725e4931
6
+ metadata.gz: 6d0674d2ddd8e84d84eb190cfa4c2a93b447ed783e06598b46e139e6a6d0771cd246fab0fb3ad2005c9c06abe3336b7a45a12ddfd98d796c21705233cb20b9e5
7
+ data.tar.gz: d4fb458df88ddf11f719317e28c12387227313f20585325d2e33f858fb1f557a07938d8e57ae313a0d53006781053e7699a7213692a95877764327e4e9aa638a
data/README.md CHANGED
@@ -65,7 +65,7 @@ gem 'jsonapi-utils', '~> 0.4.9'
65
65
  For Rails 5:
66
66
 
67
67
  ```ruby
68
- gem 'jsonapi-utils', '~> 0.5.2'
68
+ gem 'jsonapi-utils', '~> 0.6.0.beta'
69
69
  ```
70
70
 
71
71
  And then execute:
@@ -76,10 +76,14 @@ module JSONAPI
76
76
  message
77
77
  else
78
78
  resource_key = resource_key_for(key)
79
- [resource_key.to_s.tr('.', '_').humanize, message].join(' ')
79
+ [translation_for(resource_key), message].join(' ')
80
80
  end
81
81
  end
82
82
 
83
+ def translation_for(key)
84
+ object.class.human_attribute_name(key)
85
+ end
86
+
83
87
  def error_base
84
88
  {
85
89
  code: JSONAPI::VALIDATION_ERROR,
@@ -38,8 +38,12 @@ module JSONAPI::Utils
38
38
  #
39
39
  # @api public
40
40
  def process_request
41
- process_operations
42
- render_results(@operation_results)
41
+ operations = @request.operations
42
+ unless JSONAPI.configuration.resource_cache.nil?
43
+ operations.each {|op| op.options[:cache_serializer] = resource_serializer }
44
+ end
45
+ results = process_operations(operations)
46
+ render_results(results)
43
47
  rescue => e
44
48
  handle_exceptions(e)
45
49
  end
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Utils
3
- VERSION = '0.5.2'.freeze
3
+ VERSION = '0.6.0.beta'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Guedes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-03-13 00:00:00.000000000 Z
12
+ date: 2017-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-resources
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.8.3
20
+ version: 0.9.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.8.3
27
+ version: 0.9.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -193,9 +193,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
- - - ">="
196
+ - - ">"
197
197
  - !ruby/object:Gem::Version
198
- version: '0'
198
+ version: 1.3.1
199
199
  requirements: []
200
200
  rubyforge_project:
201
201
  rubygems_version: 2.6.7