aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/custom_methods.rb
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-05-17 19:30:43 -0400
committerJosh Kalderimis <josh.kalderimis@gmail.com>2011-05-18 00:34:09 -0400
commit6b4bbb427455ec1af6bdf0896a62129bd3c8c4aa (patch)
tree197f51ebb7b9b9c7987bb29aec73b7da9536cff7 /activeresource/lib/active_resource/custom_methods.rb
parent4a9365ee18c055d970a5f8faaac9443a8bfb0d24 (diff)
downloadrails-6b4bbb427455ec1af6bdf0896a62129bd3c8c4aa.tar.gz
rails-6b4bbb427455ec1af6bdf0896a62129bd3c8c4aa.tar.bz2
rails-6b4bbb427455ec1af6bdf0896a62129bd3c8c4aa.zip
updated all the tests in ARes to work with json
Diffstat (limited to 'activeresource/lib/active_resource/custom_methods.rb')
-rw-r--r--activeresource/lib/active_resource/custom_methods.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/custom_methods.rb b/activeresource/lib/active_resource/custom_methods.rb
index 9879f8cded..38473c6cf7 100644
--- a/activeresource/lib/active_resource/custom_methods.rb
+++ b/activeresource/lib/active_resource/custom_methods.rb
@@ -54,7 +54,9 @@ module ActiveResource
#
# Person.find(:all, :from => :active)
def get(custom_method_name, options = {})
- format.decode(connection.get(custom_method_collection_url(custom_method_name, options), headers).body)
+ hashified = format.decode(connection.get(custom_method_collection_url(custom_method_name, options), headers).body)
+ derooted = Formats.remove_root(hashified)
+ derooted.is_a?(Array) ? derooted.map { |e| Formats.remove_root(e) } : derooted
end
def post(custom_method_name, options = {}, body = '')