dm-restful-adapter 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,13 @@ module Restful
|
|
4
4
|
def create(resources)
|
5
5
|
resources.each { |resource|
|
6
6
|
dirty_attributes = resource.dirty_attributes.inject({}) { |hash, (k,v)| hash.update(k.name => v) }
|
7
|
-
|
7
|
+
response = Request.post(resource.model.storage_name, dirty_attributes)
|
8
|
+
properties = resource.model.properties
|
9
|
+
response.each do |attr_name, val|
|
10
|
+
if prop = properties[attr_name.to_sym]
|
11
|
+
prop.set!(resource, val)
|
12
|
+
end
|
13
|
+
end
|
8
14
|
}.size
|
9
15
|
end
|
10
16
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-restful-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Moran
|