Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Documentation of ActiveRecord 422 errors xml

#3691

I'm creating a active resource connection to a legacy program. I implemnted it using the 422 validation response in the documentation. There is a typo in the documentation in ActiveResource::Base under validation:

<errors type="array"><error>First cannot be empty</error></errors>

The attribute type="array" doesn't belong there. Luckily there is always code to fall back on ;) The Errors.from_xml just eats the errors when implemented as the documentation point out.

# Grabs errors from the XML response.
def from_xml(xml)
  array = Array.wrap(Hash.from_xml(xml)['errors']['error']) rescue []
  from_array array
end

Reported by ronin-82615 (at lighthouseapp) · January 14th, 2010 @ 10:46 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low