aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource/lib/active_resource/base.rb')
-rw-r--r--activeresource/lib/active_resource/base.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index b5ebd3961c..7f99e5cbf5 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -205,13 +205,12 @@ module ActiveResource
def update
connection.put(element_path, to_xml)
- true
end
def create
- resp = connection.post(collection_path, to_xml)
- self.id = id_from_response(resp)
- true
+ returning connection.post(collection_path, to_xml) do |response|
+ self.id = id_from_response(response)
+ end
end
# takes a response from a typical create post and pulls the ID out