Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 157 lines (102 sloc) 5.747 kb
8261f17 @jeremy start an Active Resource changelog
jeremy authored
1 *SVN*
2
1d5c34c @dhh Added find-by-path options to ActiveResource::Base.find [DHH]
dhh authored
3 * Added find-by-path options to ActiveResource::Base.find [DHH]. Examples:
4
5 employees = Person.find(:all, :from => "/companies/1/people.xml") # => GET /companies/1/people.xml
6 manager = Person.find("/companies/1/manager.xml") # => GET /companies/1/manager.xml
7
8
234b0b7 @dhh Added support for using classes from within a single nested module [DHH]
dhh authored
9 * Added support for using classes from within a single nested module [DHH]. Example:
10
11 module Highrise
12 class Note < ActiveResource::Base
13 self.site = "http://37s.sunrise.i:3000"
14 end
15
16 class Comment < ActiveResource::Base
17 self.site = "http://37s.sunrise.i:3000"
18 end
19 end
20
21 assert_kind_of Highrise::Comment, Note.find(1).comments.first
22
23
37e8e35 @dhh Added load_attributes_from_response as a way of loading attributes from ...
dhh authored
24 * Added load_attributes_from_response as a way of loading attributes from other responses than just create [DHH]
25
26 class Highrise::Task < ActiveResource::Base
27 def complete
28 load_attributes_from_response(post(:complete))
29 end
30 end
31
32 ...will set "done_at" when complete is called.
33
34
9b8399f @dhh Added support for calling custom methods #6979 [rwdaigle]
dhh authored
35 * Added support for calling custom methods #6979 [rwdaigle]
36
37 Person.find(:managers) # => GET /people/managers.xml
38 Kase.find(1).post(:close) # => POST /kases/1/close.xml
39
208d12d @technoweenie Remove explicit prefix_options parameter for ActiveResource::Base#initia...
technoweenie authored
40 * Remove explicit prefix_options parameter for ActiveResource::Base#initialize. [Rick]
41 ActiveResource splits the prefix_options from it automatically.
42
43 * Allow ActiveResource::Base.delete with custom prefix. [Rick]
44
45 * Add ActiveResource::Base#dup [Rick]
46
c97f329 @dhh Disregard namespaces from the default element name, so Highrise::Person ...
dhh authored
47 * Fixed constant warning when fetching the same object multiple times [DHH]
48
49 * Added that saves which get a body response (and not just a 201) will use that response to update themselves [DHH]
50
51 * Disregard namespaces from the default element name, so Highrise::Person will just try to fetch from "/people", not "/highrise/people" [DHH]
52
d97456d @jeremy Allow array and hash query parameters. Closes #7756.
jeremy authored
53 * Allow array and hash query parameters. #7756 [Greg Spurrier]
54
1b1ddf1 @jeremy Loading a resource preserves its prefix_options. Closes #7353. Silence p...
jeremy authored
55 * Loading a resource preserves its prefix_options. #7353 [Ryan Daigle]
56
f49e449 @technoweenie Carry over the convenience of #create from ActiveRecord. Closes #7340. ...
technoweenie authored
57 * Carry over the convenience of #create from ActiveRecord. Closes #7340. [Ryan Daigle]
58
1bdb14b @technoweenie Increase ActiveResource::Base test coverage. Closes #7173, #7174 [Rich ...
technoweenie authored
59 * Increase ActiveResource::Base test coverage. Closes #7173, #7174 [Rich Collins]
60
e00e6a2 @jeremy Interpret 422 Unprocessable Entity as ResourceInvalid. Closes #7097.
jeremy authored
61 * Interpret 422 Unprocessable Entity as ResourceInvalid. #7097 [dkubb]
62
932e7b0 @technoweenie Mega documentation patches. #7025, #7069 [rwdaigle]
technoweenie authored
63 * Mega documentation patches. #7025, #7069 [rwdaigle]
64
2bb33bb @jeremy Base.exists?(id, options) and Base#exists? check whether the resource is...
jeremy authored
65 * Base.exists?(id, options) and Base#exists? check whether the resource is found. #6970 [rwdaigle]
66
4e57ac3 @jeremy Query string support. Closes #6855.
jeremy authored
67 * Query string support. [untext, Jeremy Kemper]
68 # GET /forums/1/topics.xml?sort=created_at
69 Topic.find(:all, :forum_id => 1, :sort => 'created_at')
70
c172154 @jeremy Base#==, eql?, and hash methods. == returns true if its argument is iden...
jeremy authored
71 * 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]
72
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you can ...
jeremy authored
73 * Allow subclassed resources to share the site info [Rick, Jeremy Kemper]
2df386a @technoweenie why oh why do i always forget to save the changelog
technoweenie authored
74 d
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored
75 class BeastResource < ActiveResource::Base
76 self.site = 'http://beast.caboo.se'
77 end
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you can ...
jeremy authored
78
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored
79 class Forum < BeastResource
80 # taken from BeastResource
81 # self.site = 'http://beast.caboo.se'
82 end
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you can ...
jeremy authored
83
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored
84 class Topic < BeastResource
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you can ...
jeremy authored
85 self.site += '/forums/:forum_id'
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored
86 end
87
55d4dbb @technoweenie Fix issues with ActiveResource collection handling. Closes #6291. [bmil...
technoweenie authored
88 * Fix issues with ActiveResource collection handling. Closes #6291. [bmilekic]
89
1d31a04 Use attr_accessor_with_default to dry up attribute initialization. Refer...
Marcel Molina authored
90 * Use attr_accessor_with_default to dry up attribute initialization. References #6538. [Stuart Halloway]
91
9c94438 @jamis Add basic logging support for logging outgoing requests.
jamis authored
92 * Add basic logging support for logging outgoing requests. [Jamis Buck]
93
6c0609f @jamis Add Base.delete for deleting resources without having to instantiate the...
jamis authored
94 * Add Base.delete for deleting resources without having to instantiate them first. [Jamis Buck]
95
628838e @jamis Make #save behavior mimic AR::Base#save (true on success, false on failu...
jamis authored
96 * Make #save behavior mimic AR::Base#save (true on success, false on failure). [Jamis Buck]
97
7ac6ed8 @technoweenie Add Basic HTTP Authentication to ActiveResource (closes #6305). [jonatha...
technoweenie authored
98 * Add Basic HTTP Authentication to ActiveResource (closes #6305). [jonathan]
99
4d63e01 @technoweenie fixed failing tests now that non-GET requests are sent with .xml file ex...
technoweenie authored
100 * Extracted #id_from_response as an entry point for customizing how a created resource gets its own ID.
101 By default, it extracts from the Location response header.
102
0a84624 @jeremy Optimistic locking: raise ActiveResource::ResourceConflict on 409 Confli...
jeremy authored
103 * Optimistic locking: raise ActiveResource::ResourceConflict on 409 Conflict response. [Jeremy Kemper]
104
105 # Example controller action
106 def update
107 @person.save!
108 rescue ActiveRecord::StaleObjectError
109 render :xml => @person.reload.to_xml, :status => '409 Conflict'
110 end
111
8d9e660 @technoweenie Basic validation support [Rick Olson]
technoweenie authored
112 * Basic validation support [Rick Olson]
113
114 Parses the xml response of ActiveRecord::Errors#to_xml with a similar interface to ActiveRecord::Errors.
115
116 render :xml => @person.errors.to_xml, :status => '400 Validation Error'
117
c918fbf @jeremy Deep hashes are converted into collections of resources. Class attribute...
jeremy authored
118 * Deep hashes are converted into collections of resources. [Jeremy Kemper]
119 Person.new :name => 'Bob',
120 :address => { :id => 1, :city => 'Portland' },
121 :contacts => [{ :id => 1 }, { :id => 2 }]
122 Looks for Address and Contact resources and creates them if unavailable.
123 So clients can fetch a complex resource in a single request if you e.g.
124 render :xml => @person.to_xml(:include => [:address, :contacts])
125 in your controller action.
126
7749c9c @technoweenie Major updates to ActiveResource, please see changelog and unit tests [Ri...
technoweenie authored
127 * Major updates [Rick Olson]
128
129 * Add full support for find/create/update/destroy
130 * Add support for specifying prefixes.
131 * Allow overriding of element_name, collection_name, and primary key
132 * Provide simpler HTTP mock interface for testing
133
134 # rails routing code
135 map.resources :posts do |post|
136 post.resources :comments
137 end
138
139 # ActiveResources
140 class Post < ActiveResource::Base
141 self.site = "http://37s.sunrise.i:3000/"
142 end
143
144 class Comment < ActiveResource::Base
145 self.site = "http://37s.sunrise.i:3000/posts/:post_id/"
146 end
147
148 @post = Post.find 5
149 @comments = Comment.find :all, :post_id => @post.id
150
151 @comment = Comment.new({:body => 'hello world'}, {:post_id => @post.id})
152 @comment.save
153
f9b3694 @jeremy 200...400 are valid response codes. PUT and POST request bodies default ...
jeremy authored
154 * 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
155
8261f17 @jeremy start an Active Resource changelog
jeremy authored
156 * Initial checkin: object-oriented client for restful HTTP resources which follow the Rails convention. [DHH]
Something went wrong with that request. Please try again.