I see that deserialization of error response bodies in validation.rb
hasn't been refactored yet to use the new format serialization
abstraction, ie. (below). Should I add something to Trac about this?
# Grabs errors from the XML response.
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.each do |message|
attr_message = humanized_attributes.keys.detect do |attr_name|
if message[0, attr_name.size + 1] == "#{attr_name} "
add humanized_attributes[attr_name],
message[(attr_name.size + 1)..-1]
end
end
add_to_base message if attr_message.nil?
end
end
On Sep 25, 2:47 pm, DHH <[EMAIL PROTECTED]> wrote:
> Thanks. It could be great if people could put this stuff through the
> ringer. I haven't had a chance to do a real thorough testing of it yet
> in the wild.
>
> On Sep 25, 12:39 pm, Rus <[EMAIL PROTECTED]> wrote:
>
> > Nice work. I actually did similar work recently, but hadn't had the
> > cycles to contribute it back. I'll be sure to provide some feed back
> > though.
>
> > Cheers,
> > Rus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---