ddy_remote_resource 1.0.0.rc5 → 1.0.0.rc6

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: d688cecc3f4a1d713c2527d47a99cf88f81c9bfb
4
- data.tar.gz: 11a9c8c67d6ed14e4aa46dd9de09079204ca0507
3
+ metadata.gz: b6626cbb2285fd9fe1db1ea2c1d1ce1c61f5d852
4
+ data.tar.gz: 6ca554d432521a8f090f0ce3706015320872e129
5
5
  SHA512:
6
- metadata.gz: dc32aaed683143cf08c8a96b80adcf41d98a369cd7313ae1eabf9a527a0c9e861f41d468621b1518582d686593e097ce8e27209ae2ddbfbeaacb53cd0c4779aa
7
- data.tar.gz: 1e47f7498e9f70cff6b708d73f1e1af8189e88c3c50b422989c33abecdec0beb7ac733877d244b9b5283ba65b508dd96997d085a5f02dd1db33e3db17c629578
6
+ metadata.gz: 5c424d8a9e9a3c0a238ea91cd2c40a47b1f4ebcf17153039281117d6ba1e91826d986faca31e9e02520b37363f14c6ee681f8d999b59103acc373cabea705d24
7
+ data.tar.gz: ede94fcb7c6b653bbb31cf6d05b1ff0785bfaae35984d2e66e2f280bd093b1834fb10a4ba2095d65023b8aa9d281e1d029ce646127c043b9d2d324ac63a57c81
@@ -14,17 +14,17 @@ module RemoteResource
14
14
  end
15
15
 
16
16
  def each(&block)
17
- if resources_collection.is_a?(Array)
18
- if defined?(@collection)
19
- @collection.each(&block)
20
- else
21
- @collection = []
22
- resources_collection.each do |element|
23
- record = resource_klass.new(element.merge(@options))
24
- @collection.push(record)
25
- yield(record)
26
- end
17
+ return nil if !resources_collection.is_a?(Array)
18
+
19
+ if defined?(@collection)
20
+ @collection.each(&block)
21
+ else
22
+ @collection = []
23
+ resources_collection.each do |element|
24
+ record = resource_klass.new(element.merge(@options))
25
+ @collection.push(record)
27
26
  end
27
+ @collection.each(&block)
28
28
  end
29
29
  end
30
30
 
@@ -1,3 +1,3 @@
1
1
  module RemoteResource
2
- VERSION = '1.0.0.rc5'.freeze
2
+ VERSION = '1.0.0.rc6'.freeze
3
3
  end
@@ -116,6 +116,15 @@ RSpec.describe RemoteResource::Collection do
116
116
  expect(expected).to eql(actual)
117
117
  end
118
118
  end
119
+
120
+ it 'expands the whole collection so that finder methods will not restrict the collection' do
121
+ found_collection = collection.find { |element| element.id == 1 }
122
+
123
+ aggregate_failures do
124
+ expect(found_collection).to be_present
125
+ expect(collection.size).to eql 2
126
+ end
127
+ end
119
128
  end
120
129
 
121
130
  context 'when the resources_collection is NOT an Array' do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe RemoteResource::VERSION do
4
- it { is_expected.to eql '1.0.0.rc5' }
4
+ it { is_expected.to eql '1.0.0.rc6' }
5
5
  end
6
6
 
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddy_remote_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc5
4
+ version: 1.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan van der Pas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-17 00:00:00.000000000 Z
11
+ date: 2017-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler