diff options
author | Jatinder Singh <jatinder.saundh@gmail.com> | 2010-01-27 15:28:32 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-01-27 18:27:18 -0800 |
commit | e87748869af238fe6bcb78e8d9a8d2bbc3734039 (patch) | |
tree | d4fcaebe619db3a8cb82ae14e2b6719ac540dc84 /activeresource/lib/active_resource | |
parent | e98f9579c472e75f5a8c0678f2fc54b2d681e3ec (diff) | |
download | rails-e87748869af238fe6bcb78e8d9a8d2bbc3734039.tar.gz rails-e87748869af238fe6bcb78e8d9a8d2bbc3734039.tar.bz2 rails-e87748869af238fe6bcb78e8d9a8d2bbc3734039.zip |
Use format of ARes rather than content-type of remote errors to load errors.
[#1956 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r-- | 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 7b2382bd8c..4774c6dd22 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -101,10 +101,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 |