This project is archived and is in readonly mode.
ActiveResource not picking up (validation) errors in 2.3.4
-
James Brennan
I'm seeing the same error. It's very possible that this is being caused by the case/when block starting on line 262 of validations.rb
case error.response['Content-Type'] when 'application/xml' errors.from_xml(error.response.body) when 'application/json' errors.from_json(error.response.body) end falseI'm about to write a patch, unless someone else has already done it?
-
James Brennan
My last post wasn't entirely clear. I'm seeing it fail when the error.response['Content-Type'] = "application/xml; charset=utf-8"
-
Łukasz Pinkosz
I also came across this issue.
When I call this on my remote service:
render returns following content-type in response header:render :xml => @my_object.errors, :status => :unprocessable_entity
That obviously won't match line 263 of validations.rb. So I changed the case block to:"application/xml; charset=utf-8"
case error.response['Content-Type']
when /application\/xml/ errors.from_xml(error.response.body) when /application\/json/ errors.from_json(error.response.body) end</code>
And now works as expected.
-
JackC
It looks like this has been fixed in 2-3-stable.
http://github.com/rails/rails/commit/1488c6cc9e6237ce794e3c4a620162...
-
Jeremy Kemper
- State changed from new to duplicate