From dc399b96c84bc66b7c20e92fb40e9ed00daf99c2 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 20 Sep 2007 23:18:05 +0000 Subject: Added ActiveResource.format= which defaults to :xml but can also be set to :json [DHH]. Added one-off declarations of mock behavior [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7518 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activeresource/CHANGELOG | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'activeresource/CHANGELOG') diff --git a/activeresource/CHANGELOG b/activeresource/CHANGELOG index cde84be05b..811669dff9 100644 --- a/activeresource/CHANGELOG +++ b/activeresource/CHANGELOG @@ -1,5 +1,30 @@ *SVN* +* Added one-off declarations of mock behavior [DHH]. Example: + + Before: + ActiveResource::HttpMock.respond_to do |mock| + mock.get "/people/1.xml", {}, "David" + end + + Now: + ActiveResource::HttpMock.respond_to.get "/people/1.xml", {}, "David" + +* Added ActiveResource.format= which defaults to :xml but can also be set to :json [DHH]. 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 Mary + * 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] -- cgit v1.2.3