From 9568c0e962edd1ddd93c9c9fa4136d640d68a747 Mon Sep 17 00:00:00 2001 From: Jatinder Singh Date: Mon, 26 Oct 2009 23:33:40 -0700 Subject: [PATCH] Use format of ARes rather than content-type of remote errors to load errors. --- activeresource/lib/active_resource/validations.rb | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index 67b69fa..b263402 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -92,10 +92,10 @@ module ActiveResource # Loads the set of remote errors into the object's Errors based on the # content-type of the error-block received def load_remote_errors(remote_errors, save_cache = false ) #:nodoc: - case remote_errors.response['Content-Type'] - when /xml/ + case self.class.format + when ActiveResource::Formats[:xml] errors.from_xml(remote_errors.response.body, save_cache) - when /json/ + when ActiveResource::Formats[:json] errors.from_json(remote_errors.response.body, save_cache) end end -- 1.6.1.3