diff options
Diffstat (limited to 'activeresource/lib/active_resource/formats')
-rw-r--r-- | activeresource/lib/active_resource/formats/json_format.rb | 2 | ||||
-rw-r--r-- | activeresource/lib/active_resource/formats/xml_format.rb | 13 |
2 files changed, 2 insertions, 13 deletions
diff --git a/activeresource/lib/active_resource/formats/json_format.rb b/activeresource/lib/active_resource/formats/json_format.rb index 9980634921..827d1cc23a 100644 --- a/activeresource/lib/active_resource/formats/json_format.rb +++ b/activeresource/lib/active_resource/formats/json_format.rb @@ -18,7 +18,7 @@ module ActiveResource end def decode(json) - ActiveSupport::JSON.decode(json) + Formats.remove_root(ActiveSupport::JSON.decode(json)) end end end diff --git a/activeresource/lib/active_resource/formats/xml_format.rb b/activeresource/lib/active_resource/formats/xml_format.rb index 3b2575cfa1..49cb9aa1ac 100644 --- a/activeresource/lib/active_resource/formats/xml_format.rb +++ b/activeresource/lib/active_resource/formats/xml_format.rb @@ -18,19 +18,8 @@ module ActiveResource end def decode(xml) - from_xml_data(Hash.from_xml(xml)) + Formats.remove_root(Hash.from_xml(xml)) end - - private - # Manipulate from_xml Hash, because xml_simple is not exactly what we - # want for Active Resource. - def from_xml_data(data) - if data.is_a?(Hash) && data.keys.size == 1 - data.values.first - else - data - end - end end end end |