flexirest 1.3.4 → 1.3.5
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/flexirest/result_iterator.rb +4 -0
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/associations_spec.rb +18 -0
- 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: 72686cd331c6be616ddc6595d627fa5e19b12fbb
|
4
|
+
data.tar.gz: d259d2ffee7a14396924bfd8d14b65ec51d2022a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 942d3cc68e549d9d916cf1ef22528995f6852b904501dca4a2e3dd68457acc820408d86ed8d9e14e152f2b40a78deb5835f5e4cc351f80572228fa8bdb00d2fc
|
7
|
+
data.tar.gz: 7f517c2b407b895cdf8d3c2660079cc9781ee50c968843bdc1de77a49abcf2094aec68258a7dae042b9a99c04f50c16fb23cfab6c3f075c57e5113c0999737e5
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/version.rb
CHANGED
@@ -16,6 +16,19 @@ class AssociationExampleBase < Flexirest::Base
|
|
16
16
|
has_one :association_example_other
|
17
17
|
end
|
18
18
|
|
19
|
+
class DeepNestedHasManyChildExample < Flexirest::Base
|
20
|
+
end
|
21
|
+
|
22
|
+
class DeepNestedHasManyTopExample < Flexirest::Base
|
23
|
+
has_many :entries, DeepNestedHasManyChildExample
|
24
|
+
end
|
25
|
+
|
26
|
+
class DeepNestedHasManyExample < Flexirest::Base
|
27
|
+
has_many :results, DeepNestedHasManyTopExample
|
28
|
+
hash = { results: [ { entries: [ { items: [ "item one", "item two" ] } ] }, { entries: [ { items: [ "item three", "item four" ] } ] } ] }
|
29
|
+
get :find, "/iterate", fake: hash.to_json
|
30
|
+
end
|
31
|
+
|
19
32
|
describe "Has Many Associations" do
|
20
33
|
let(:subject) {AssociationExampleBase.new}
|
21
34
|
|
@@ -54,6 +67,11 @@ describe "Has Many Associations" do
|
|
54
67
|
subject.others = [{nested: [{test: "foo"}]}]
|
55
68
|
expect(subject.others.first.nested.first.test).to eq("foo")
|
56
69
|
end
|
70
|
+
|
71
|
+
it "should correctly work with deep nested associations" do
|
72
|
+
finder = DeepNestedHasManyExample.find
|
73
|
+
expect(finder.results.count).to eq(2)
|
74
|
+
end
|
57
75
|
end
|
58
76
|
|
59
77
|
describe "Has One Associations" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexirest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|