aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/validations.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-02-19 21:20:15 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-02-19 21:20:15 +0100
commitd8f1ee4b41352b870f617b01099b2877f754d32c (patch)
treedd6bdf1d1ded6aab7bb926109a24e942fc740b73 /activeresource/lib/active_resource/validations.rb
parent8ba1fc18e13c03966d411947180022c1730e81ff (diff)
parent7c0e008973e594ebf53607362c1dfbe34b693600 (diff)
downloadrails-d8f1ee4b41352b870f617b01099b2877f754d32c.tar.gz
rails-d8f1ee4b41352b870f617b01099b2877f754d32c.tar.bz2
rails-d8f1ee4b41352b870f617b01099b2877f754d32c.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'activeresource/lib/active_resource/validations.rb')
-rw-r--r--activeresource/lib/active_resource/validations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb
index 4bc906d291..de3339935f 100644
--- a/activeresource/lib/active_resource/validations.rb
+++ b/activeresource/lib/active_resource/validations.rb
@@ -203,7 +203,7 @@ module ActiveResource
def from_xml(xml)
clear
humanized_attributes = @base.attributes.keys.inject({}) { |h, attr_name| h.update(attr_name.humanize => attr_name) }
- messages = Hash.from_xml(xml)['errors']['error'] rescue []
+ messages = Array.wrap(Hash.from_xml(xml)['errors']['error']) rescue []
messages.each do |message|
attr_message = humanized_attributes.keys.detect do |attr_name|
if message[0, attr_name.size + 1] == "#{attr_name} "