jsonapi-utils 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jsonapi/utils.rb +5 -5
- data/lib/jsonapi/utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd9b7abb145201ff33ce27c5fa8a70c37914eb94
|
4
|
+
data.tar.gz: 188eb2baf1d0f0182b60257cdebab1696cc9d8ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d332f2619cb712f97f6f7b104a615fa67d7baed80736580401d7966ef6a9901c60c88404f544cc77ec844af764bcf09efde3cf574304e510c27c8aef4075460
|
7
|
+
data.tar.gz: 111fcd196807c42afe7bddea2a8291499efca754aef0c0c8c876656a46ee485d736373af39b0de192df40d5a25ff455cab6de35130ea118bb21f2f0a8fee3eec
|
data/lib/jsonapi/utils.rb
CHANGED
@@ -26,11 +26,11 @@ module JSONAPI
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def jsonapi_render_internal_server_error
|
29
|
-
|
29
|
+
jsonapi_render_errors(::JSONAPI::Utils::Exceptions::InternalServerError.new)
|
30
30
|
end
|
31
31
|
|
32
32
|
def jsonapi_render_bad_request
|
33
|
-
|
33
|
+
jsonapi_render_errors(::JSONAPI::Utils::Exceptions::BadRequest.new)
|
34
34
|
end
|
35
35
|
|
36
36
|
def jsonapi_render_not_found
|
@@ -105,10 +105,10 @@ module JSONAPI
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def build_collection(records, options = {})
|
108
|
-
|
109
|
-
JSONAPI.configuration.default_paginator == :none ||
|
108
|
+
unless JSONAPI.configuration.default_paginator == :none
|
110
109
|
records = paginator(@request.params).apply(records, nil)
|
111
|
-
|
110
|
+
end
|
111
|
+
records.respond_to?(:to_ary) ? records.map { |record| turn_into_resource(record, options) } : []
|
112
112
|
end
|
113
113
|
|
114
114
|
def turn_into_resource(record, options = {})
|
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.3.
|
4
|
+
version: 0.3.3
|
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: 2015-11-
|
12
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|