Rails 2.3.3.1

Update to latest Rails.
A little bit of jiggery-pokery is involved, since they
neglected to re-include vendored Rack in this release.
This commit is contained in:
Jacques Distler 2009-08-04 10:16:03 -05:00
parent 329fafafce
commit 664552ac02
257 changed files with 4346 additions and 1682 deletions

View file

@ -832,7 +832,7 @@ module ActiveResource
!new? && self.class.exists?(to_param, :params => prefix_options)
end
# A method to convert the the resource to an XML string.
# Converts the resource to an XML string representation.
#
# ==== Options
# The +options+ parameter is handed off to the +to_xml+ method on each
@ -841,7 +841,14 @@ module ActiveResource
#
# * <tt>:indent</tt> - Set the indent level for the XML output (default is +2+).
# * <tt>:dasherize</tt> - Boolean option to determine whether or not element names should
# replace underscores with dashes (default is <tt>false</tt>).
# replace underscores with dashes. Default is <tt>true</tt>. The default can be set to <tt>false</tt>
# by setting the module attribute <tt>ActiveSupport.dasherize_xml = false</tt> in an initializer. Because save
# uses this method, and there are no options on save, then you will have to set the default if you don't
# want underscores in element names to become dashes when the resource is saved. This is important when
# integrating with non-Rails applications.
# * <tt>:camelize</tt> - Boolean option to determine whether or not element names should be converted
# to camel case, e.g some_name to SomeName. Default is <tt>false</tt>. Like <tt>:dasherize</tt> you can
# change the default by setting the module attribute <tt>ActiveSupport.camelise_xml = true</tt> in an initializer.
# * <tt>:skip_instruct</tt> - Toggle skipping the +instruct!+ call on the XML builder
# that generates the XML declaration (default is <tt>false</tt>).
#
@ -861,8 +868,7 @@ module ActiveResource
attributes.to_xml({:root => self.class.element_name}.merge(options))
end
# Returns a JSON string representing the model. Some configuration is
# available through +options+.
# Coerces to a hash for JSON encoding.
#
# ==== Options
# The +options+ are passed to the +to_json+ method on each
@ -886,8 +892,8 @@ module ActiveResource
#
# person.to_json(:except => ["first_name"])
# # => {"last_name": "Smith"}
def to_json(options={})
attributes.to_json(options)
def as_json(options = nil)
attributes.as_json(options)
end
# Returns the serialized string representation of the resource in the configured

View file

@ -11,8 +11,8 @@ module ActiveResource
"application/json"
end
def encode(hash, options={})
hash.to_json(options)
def encode(hash, options = nil)
ActiveSupport::JSON.encode(hash, options)
end
def decode(json)

View file

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