Rails 2.3.5

Upgrade to Rails 2.3.5.
Also work around this bug:
 https://rails.lighthouseapp.com/projects/8994/tickets/3524
created by the aforementioned
Rails release.
This commit is contained in:
Jacques Distler 2009-11-30 19:38:34 -06:00
parent a6429f8c22
commit e3832c6f79
187 changed files with 2316 additions and 891 deletions

View file

@ -1,3 +1,12 @@
*2.3.5 (November 25, 2009)*
* Minor Bug Fixes and deprecation warnings
* More flexible content type handling when parsing responses.
Ensures that ARes will handle responses like test/xml, or content types
with charsets included.
*2.3.4 (September 4, 2009)*
* Add support for errors in JSON format. #1956 [Fabien Jakimowicz]

View file

@ -66,7 +66,7 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
s.add_dependency('activesupport', '= 2.3.4' + PKG_BUILD)
s.add_dependency('activesupport', '= 2.3.5' + PKG_BUILD)
s.require_path = 'lib'
s.autorequire = 'active_resource'

View file

@ -260,9 +260,9 @@ module ActiveResource
true
rescue ResourceInvalid => error
case error.response['Content-Type']
when 'application/xml'
when /xml/
errors.from_xml(error.response.body)
when 'application/json'
when /json/
errors.from_json(error.response.body)
end
false

View file

@ -2,7 +2,7 @@ module ActiveResource
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
TINY = 4
TINY = 5
STRING = [MAJOR, MINOR, TINY].join('.')
end

View file

@ -1 +1,2 @@
require 'active_resource'
ActiveSupport::Deprecation.warn 'require "activeresource" is deprecated and will be removed in Rails 3. Use require "active_resource" instead.'

View file

@ -4,8 +4,8 @@ require "fixtures/person"
class BaseErrorsTest < Test::Unit::TestCase
def setup
ActiveResource::HttpMock.respond_to do |mock|
mock.post "/people.xml", {}, %q(<?xml version="1.0" encoding="UTF-8"?><errors><error>Age can't be blank</error><error>Name can't be blank</error><error>Name must start with a letter</error><error>Person quota full for today.</error></errors>), 422, {'Content-Type' => 'application/xml'}
mock.post "/people.json", {}, %q({"errors":["Age can't be blank","Name can't be blank","Name must start with a letter","Person quota full for today."]}), 422, {'Content-Type' => 'application/json'}
mock.post "/people.xml", {}, %q(<?xml version="1.0" encoding="UTF-8"?><errors><error>Age can't be blank</error><error>Name can't be blank</error><error>Name must start with a letter</error><error>Person quota full for today.</error></errors>), 422, {'Content-Type' => 'application/xml; charset=utf-8'}
mock.post "/people.json", {}, %q({"errors":["Age can't be blank","Name can't be blank","Name must start with a letter","Person quota full for today."]}), 422, {'Content-Type' => 'application/json; charset=utf-8'}
end
@person = Person.new(:name => '', :age => '')
assert_equal @person.save, false