Skip to content

HTTPS clone URL

Subversion checkout URL

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