Skip to content
Newer
Older
100644 68 lines (47 sloc) 2.45 KB
8261f17 @jeremy start an Active Resource changelog
jeremy authored
1 *SVN*
2
9c94438 @jamis Add basic logging support for logging outgoing requests.
jamis authored
3 * Add basic logging support for logging outgoing requests. [Jamis Buck]
4
6c0609f @jamis Add Base.delete for deleting resources without having to instantiate …
jamis authored
5 * Add Base.delete for deleting resources without having to instantiate them first. [Jamis Buck]
6
628838e @jamis Make #save behavior mimic AR::Base#save (true on success, false on fa…
jamis authored
7 * Make #save behavior mimic AR::Base#save (true on success, false on failure). [Jamis Buck]
8
7ac6ed8 @technoweenie Add Basic HTTP Authentication to ActiveResource (closes #6305). [jona…
technoweenie authored
9 * Add Basic HTTP Authentication to ActiveResource (closes #6305). [jonathan]
10
4d63e01 @technoweenie fixed failing tests now that non-GET requests are sent with .xml file…
technoweenie authored
11 * Extracted #id_from_response as an entry point for customizing how a created resource gets its own ID.
12 By default, it extracts from the Location response header.
13
0a84624 @jeremy Optimistic locking: raise ActiveResource::ResourceConflict on 409 Con…
jeremy authored
14 * Optimistic locking: raise ActiveResource::ResourceConflict on 409 Conflict response. [Jeremy Kemper]
15
16 # Example controller action
17 def update
18 @person.save!
19 rescue ActiveRecord::StaleObjectError
20 render :xml => @person.reload.to_xml, :status => '409 Conflict'
21 end
22
8d9e660 @technoweenie Basic validation support [Rick Olson]
technoweenie authored
23 * Basic validation support [Rick Olson]
24
25 Parses the xml response of ActiveRecord::Errors#to_xml with a similar interface to ActiveRecord::Errors.
26
27 render :xml => @person.errors.to_xml, :status => '400 Validation Error'
28
c918fbf @jeremy Deep hashes are converted into collections of resources. Class attrib…
jeremy authored
29 * Deep hashes are converted into collections of resources. [Jeremy Kemper]
30 Person.new :name => 'Bob',
31 :address => { :id => 1, :city => 'Portland' },
32 :contacts => [{ :id => 1 }, { :id => 2 }]
33 Looks for Address and Contact resources and creates them if unavailable.
34 So clients can fetch a complex resource in a single request if you e.g.
35 render :xml => @person.to_xml(:include => [:address, :contacts])
36 in your controller action.
37
7749c9c @technoweenie Major updates to ActiveResource, please see changelog and unit tests …
technoweenie authored
38 * Major updates [Rick Olson]
39
40 * Add full support for find/create/update/destroy
41 * Add support for specifying prefixes.
42 * Allow overriding of element_name, collection_name, and primary key
43 * Provide simpler HTTP mock interface for testing
44
45 # rails routing code
46 map.resources :posts do |post|
47 post.resources :comments
48 end
49
50 # ActiveResources
51 class Post < ActiveResource::Base
52 self.site = "http://37s.sunrise.i:3000/"
53 end
54
55 class Comment < ActiveResource::Base
56 self.site = "http://37s.sunrise.i:3000/posts/:post_id/"
57 end
58
59 @post = Post.find 5
60 @comments = Comment.find :all, :post_id => @post.id
61
62 @comment = Comment.new({:body => 'hello world'}, {:post_id => @post.id})
63 @comment.save
64
f9b3694 @jeremy 200...400 are valid response codes. PUT and POST request bodies defau…
jeremy authored
65 * Base.site= accepts URIs. 200...400 are valid response codes. PUT and POST request bodies default to ''. [Jeremy Kemper]
c1af2db @jeremy site= accepts URIs
jeremy authored
66
8261f17 @jeremy start an Active Resource changelog
jeremy authored
67 * Initial checkin: object-oriented client for restful HTTP resources which follow the Rails convention. [DHH]
Something went wrong with that request. Please try again.