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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6626cbb2285fd9fe1db1ea2c1d1ce1c61f5d852
|
4
|
+
data.tar.gz: 6ca554d432521a8f090f0ce3706015320872e129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
|
@@ -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
|
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.
|
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:
|
11
|
+
date: 2017-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|