* Redirect responses: 303 See Other and 307 Temporary Redirect now behave like
301 Moved Permanently and 302 Found. GH #3302.
*Jim Herz*
## Rails 3.1.1 (October 7, 2011) ##
* No changes.
## Rails 3.1.0 (August 30, 2011) ##
* The default format has been changed to JSON for all requests. If you want to continue to use XML you will need to set `self.format = :xml` in the class. eg.
class User <ActiveResource::Baseself.format =:xml
end
## Rails 3.0.7 (April 18, 2011) ##
* No changes.
* Rails 3.0.6 (April 5, 2011)
* No changes.
## Rails 3.0.5 (February 26, 2011) ##
* No changes.
## Rails 3.0.4 (February 8, 2011) ##
* No changes.
## Rails 3.0.3 (November 16, 2010) ##
* No changes.
## Rails 3.0.2 (November 15, 2010) ##
* No changes
## Rails 3.0.1 (October 15, 2010) ##
* No Changes, just a version bump.
## Rails 3.0.0 (August 29, 2010) ##
* JSON: set Base.include_root_in_json = true to include a root value in the JSON: {"post": {"title": ...}}. Mirrors the Active Record option. *Santiago Pastorino*
* Add support for errors in JSON format. #1956*Fabien Jakimowicz*
* Recognizes 410 as Resource Gone. #2316*Jordan Brough, Jatinder Singh*
* Added ActiveResource.format= which defaults to :xml but can also be set to :json [David Heinemeier Hansson]. Example:
class Person <ActiveResource::Base
self.site = "http://app/"
self.format = :json
end
person = Person.find(1) # => GET http://app/people/1.json
person.name = "David"
person.save # => PUT http://app/people/1.json {name: "David"}
Person.format = :xml
person.name = "Mary"
person.save # => PUT http://app/people/1.json <person><name>Mary</name></person>
* Fix reload error when path prefix is used. #8727*Ian Warshak*
* Remove ActiveResource::Struct because it hasn't proven very useful. Creating a new ActiveResource::Base subclass is often less code and always clearer. #8612*Josh Peek*
* Fix query methods on resources. *Cody Fauser*
* pass the prefix_options to the instantiated record when using find without a specific id. Closes #8544*Eloy Duran*
* Recognize and raise an exception on 405 Method Not Allowed responses. #7692*Josh Peek*
* Handle string and symbol param keys when splitting params into prefix params and query params.
* Added find-one with symbol [David Heinemeier Hansson]. Example: Person.find(:one, :from => :leader) # => GET /people/leader.xml
* BACKWARDS INCOMPATIBLE: Changed the finder API to be more extensible with :params and more strict usage of scopes [David Heinemeier Hansson]. Changes:
* Added load_attributes_from_response as a way of loading attributes from other responses than just create *David Heinemeier Hansson*
class Highrise::Task <ActiveResource::Base
def complete
load_attributes_from_response(post(:complete))
end
end
...will set "done_at" when complete is called.
* Added support for calling custom methods #6979*rwdaigle*
Person.find(:managers) # => GET /people/managers.xml
Kase.find(1).post(:close) # => POST /kases/1/close.xml
* Remove explicit prefix_options parameter for ActiveResource::Base#initialize. *Rick Olson*
ActiveResource splits the prefix_options from it automatically.
* Allow ActiveResource::Base.delete with custom prefix. *Rick Olson*
* Add ActiveResource::Base#dup *Rick Olson*
* Fixed constant warning when fetching the same object multiple times *David Heinemeier Hansson*
* Added that saves which get a body response (and not just a 201) will use that response to update themselves *David Heinemeier Hansson*
* Disregard namespaces from the default element name, so Highrise::Person will just try to fetch from "/people", not "/highrise/people" *David Heinemeier Hansson*
* Allow array and hash query parameters. #7756*Greg Spurrier*
* Loading a resource preserves its prefix_options. #7353*Ryan Daigle*
* Carry over the convenience of #create from ActiveRecord. Closes #7340. *Ryan Daigle*
* Increase ActiveResource::Base test coverage. Closes #7173, #7174*Rich Collins*
* Interpret 422 Unprocessable Entity as ResourceInvalid. #7097*dkubb*
* Mega documentation patches. #7025, #7069*rwdaigle*
* Base.exists?(id, options) and Base#exists? check whether the resource is found. #6970*rwdaigle*
* Base#==, eql?, and hash methods. == returns true if its argument is identical to self or if it's an instance of the same class, is not new?, and has the same id. eql? is an alias for ==. hash delegates to id. *Jeremy Kemper*
* Allow subclassed resources to share the site info *Rick Olson, Jeremy Kemper*
d class BeastResource <ActiveResource::Base
self.site = 'http://beast.caboo.se'
end
class Forum <BeastResource
# taken from BeastResource
# self.site = 'http://beast.caboo.se'
end
class Topic <BeastResource
self.site += '/forums/:forum_id'
end
* Fix issues with ActiveResource collection handling. Closes #6291. *bmilekic*
* Use attr_accessor_with_default to dry up attribute initialization. References #6538. *Stuart Halloway*
* Add basic logging support for logging outgoing requests. *Jamis Buck*
* Add Base.delete for deleting resources without having to instantiate them first. *Jamis Buck*
* Make #save behavior mimic AR::Base#save (true on success, false on failure). *Jamis Buck*
* Add Basic HTTP Authentication to ActiveResource (closes #6305). *jonathan*
* Extracted #id_from_response as an entry point for customizing how a created resource gets its own ID.
By default, it extracts from the Location response header.