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
- resource.attributes = Request.post(resource.model.storage_name, dirty_attributes)
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
 
@@ -1,7 +1,7 @@
1
1
  module DataMapper
2
2
  module Adapters
3
3
  module RestfulAdapter
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
6
6
  end
7
7
  end
@@ -4,6 +4,7 @@ class CreateHeffalumpModels < ActiveRecord::Migration
4
4
  t.string :color
5
5
  t.integer :num_spots
6
6
  t.boolean :striped
7
+ t.timestamps
7
8
  end
8
9
  end
9
10
  end
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: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Moran