restful_resource 0.8.19 → 0.8.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restful_resource/associations.rb +2 -2
- data/lib/restful_resource/version.rb +1 -1
- data/spec/fixtures.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e331eba07a0e8c7a74b10add8adb9b76b913133f
|
4
|
+
data.tar.gz: 5a9ec4b285423351c9e9495c655e62e9b9c3abdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eae107d9e38d8cf10ffcf9ca9895ceefe1d34bcc1e28b41ba55bffa154b8b323102fbb1e1a34edfcffa6d005cc13be0ec527af73a7f52bf94d9b3fda0b28e6e0
|
7
|
+
data.tar.gz: b7f374115802d5259c635c0f4d3e65b05fe681d701d28da534da6aa3b40e76a2c71052022de34c526abe4958907d9eadad2211ace3e0ac682d5e6e417827ef16
|
@@ -7,7 +7,7 @@ module RestfulResource
|
|
7
7
|
|
8
8
|
self.send(:define_method, nested_resource_type) do
|
9
9
|
klass = klass_name.safe_constantize
|
10
|
-
klass = RestfulResource::OpenObject if (klass.nil? || (klass
|
10
|
+
klass = RestfulResource::OpenObject if (klass.nil? || !(klass < RestfulResource::Base))
|
11
11
|
@inner_object.send(nested_resource_type).map { |obj| klass.new(obj) }
|
12
12
|
end
|
13
13
|
end
|
@@ -19,7 +19,7 @@ module RestfulResource
|
|
19
19
|
|
20
20
|
self.send(:define_method, nested_resource_type) do
|
21
21
|
klass = klass_name.safe_constantize
|
22
|
-
klass = RestfulResource::OpenObject if (klass.nil? || (klass
|
22
|
+
klass = RestfulResource::OpenObject if (klass.nil? || !(klass < RestfulResource::Base))
|
23
23
|
nested_resource = @inner_object.send(nested_resource_type)
|
24
24
|
return nil if nested_resource.nil?
|
25
25
|
klass.new(@inner_object.send(nested_resource_type))
|
data/spec/fixtures.rb
CHANGED
@@ -29,7 +29,7 @@ class TestB < BaseB
|
|
29
29
|
end
|
30
30
|
|
31
31
|
module ComplicatedModule
|
32
|
-
class Parent <
|
32
|
+
class Parent < BaseA
|
33
33
|
resource_path "parent"
|
34
34
|
has_many :children
|
35
35
|
|
@@ -38,7 +38,7 @@ module ComplicatedModule
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
class Child <
|
41
|
+
class Child < BaseA
|
42
42
|
resource_path 'parents/:parent_id/children'
|
43
43
|
has_one :parent
|
44
44
|
|