diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-20 23:18:05 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-20 23:18:05 +0000 |
commit | dc399b96c84bc66b7c20e92fb40e9ed00daf99c2 (patch) | |
tree | 57edd3b3d5cf446392aaecfebc5a1831e960e4c8 /activeresource/CHANGELOG | |
parent | bd311ce9221f1df9711c791d9abfae89e029924d (diff) | |
download | rails-dc399b96c84bc66b7c20e92fb40e9ed00daf99c2.tar.gz rails-dc399b96c84bc66b7c20e92fb40e9ed00daf99c2.tar.bz2 rails-dc399b96c84bc66b7c20e92fb40e9ed00daf99c2.zip |
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
Diffstat (limited to 'activeresource/CHANGELOG')
-rw-r--r-- | activeresource/CHANGELOG | 25 |
1 files changed, 25 insertions, 0 deletions
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", {}, "<person><name>David</name></person>" + end + + Now: + ActiveResource::HttpMock.respond_to.get "/people/1.xml", {}, "<person><name>David</name></person>" + +* 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 <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] |