json_api_client 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_api_client/result_set.rb +3 -1
- data/lib/json_api_client/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: 14549cf101710d2ea86837fa6dc0c56f89041a5e
|
4
|
+
data.tar.gz: 88fe8a3ddcc3284f53f3b7f17be2a69d30c991b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fedbd2ffa56540b3f8fdc9d61f07b81904da5b447d918b75a22a439013363499958bc4d2ca64c245cc1c9a89c91bf4a5c8ac1661d52a1f83e919b5daa6ab3d9
|
7
|
+
data.tar.gz: 4beedfe80934876cba60baa9628082341d8a3e74b0b297352e8605913e5ff422d5208b6e3c60c3090f970673dd8ec82021f95b4f5c9c0814078dc8e9cfb89ec7
|
@@ -12,7 +12,9 @@ module JsonApiClient
|
|
12
12
|
alias_attribute :limit_value, :per_page
|
13
13
|
|
14
14
|
def self.build(klass, data)
|
15
|
-
|
15
|
+
# Objects representing an individual resource are
|
16
|
+
# not necessarily wrapped in an Array; enforce wrapping
|
17
|
+
result_data = [data.fetch(klass.table_name, [])].flatten
|
16
18
|
new(result_data.map {|attributes| klass.new(attributes) }).tap do |result_set|
|
17
19
|
result_set.record_class = klass
|
18
20
|
yield(result_set) if block_given?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Ching
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|