json_api_client 0.6.0 → 0.7.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: 12b14973ffe9a4a87d4981a8b56d0817e65c8816
4
- data.tar.gz: 975fa606cb2b0bea5af663ed098ad45990327efe
3
+ metadata.gz: 14549cf101710d2ea86837fa6dc0c56f89041a5e
4
+ data.tar.gz: 88fe8a3ddcc3284f53f3b7f17be2a69d30c991b2
5
5
  SHA512:
6
- metadata.gz: 6b51a687c23ea5a3f4bfddb16c621724d9e41870567c4386a68db8d0486c6003118a83fb657fab6b3a19699c093db0e951a7f2dffdc22b30f893ca916f482610
7
- data.tar.gz: c6d1d89ccae79e4c9a17f861eb98f1a7030ee3d816304680d84ae17c7ed8b594b271a3378644b2b0816549e89354d875622468842dfcd4b54d1e3f44d8aa0c8e
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
- result_data = data.fetch(klass.table_name, [])
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?
@@ -1,3 +1,3 @@
1
1
  module JsonApiClient
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
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.6.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-10-07 00:00:00.000000000 Z
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport