restful_resource 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fe060c35468d46b0d26af25f25d4ee1e076dbc93d7002a3d3fd34d724ca7f8ab
|
4
|
+
data.tar.gz: 8eaad0324ee6834eee65ac50d190b1502bc6479825a29dbd7351c35b2a5efb6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 628811833dd6340f11595c8bbab15dfd2928857d0f0669533923b48cafa037016aced821665f71868e43668d07abfa79b66a810cd60e0d7caca14fdacbcaf5a9
|
7
|
+
data.tar.gz: 9adb954ac975fe831bd416de7f1461511ba4a3e3dd0946c7a6c77131e6ad887e98c370967dee289b74c7242d22e57ce542dbe15c34905427004108533b7720e3
|
@@ -12,7 +12,9 @@ module RestfulResource
|
|
12
12
|
nil
|
13
13
|
end
|
14
14
|
klass = RestfulResource::OpenObject if (klass.nil? || !(klass < RestfulResource::OpenObject))
|
15
|
-
@inner_object.send(nested_resource_type)
|
15
|
+
nested_resource = @inner_object.send(nested_resource_type)
|
16
|
+
return nil if nested_resource.nil?
|
17
|
+
nested_resource.map { |obj| klass.new(obj) }
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
data/spec/fixtures.rb
CHANGED
@@ -27,6 +27,10 @@ describe RestfulResource::Associations do
|
|
27
27
|
it "should use open object when can't infer class name of association" do
|
28
28
|
expect(@parent.other_things.first.stuff).to eq 'aaa'
|
29
29
|
end
|
30
|
+
|
31
|
+
it "should return nil for missing associations" do
|
32
|
+
expect(@parent.missing).to be_nil
|
33
|
+
end
|
30
34
|
end
|
31
35
|
|
32
36
|
describe "#has_one" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Santoro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-04-
|
12
|
+
date: 2018-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
258
|
version: '0'
|
259
259
|
requirements: []
|
260
260
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.6
|
261
|
+
rubygems_version: 2.7.6
|
262
262
|
signing_key:
|
263
263
|
specification_version: 4
|
264
264
|
summary: A simple activerecord inspired rest resource base class implemented using
|