Skip to content
Newer
Older
100644 245 lines (153 sloc) 8.99 KB
a1ec3aa @jeremy Ruby 1.9 compatibility
jeremy authored Dec 21, 2007
1 *SVN*
2
9300ebd @dhh Fixed that to_param should be used and honored instead of hardcoding …
dhh authored Mar 28, 2008
3 * Fixed that to_param should be used and honored instead of hardcoding the id #11406 [gspiers]
4
ca94136 @lifo Improve documentation.
lifo authored Mar 26, 2008
5 * Improve documentation. [Radar, Jan De Poorter, chuyeow, xaviershay, danger, miloops, Xavier Noria, Sunny Ripert]
6
5396b0f @NZKoz Use HEAD instead of GET inside exists? Closes #11062 [bscofield]
NZKoz authored Feb 9, 2008
7 * Use HEAD instead of GET in exists? [bscofield]
8
4261b83 @technoweenie Fix small documentation typo. Closes #10670 [l.guidi]
technoweenie authored Jan 2, 2008
9 * Fix small documentation typo. Closes #10670 [l.guidi]
10
9a97f9a @jeremy find_or_create_resource_for handles module nesting. Closes #10646.
jeremy authored Jan 2, 2008
11 * find_or_create_resource_for handles module nesting. #10646 [xavier]
12
e873071 @technoweenie Allow setting ActiveResource::Base#format before #site. [rick]
technoweenie authored Dec 28, 2007
13 * Allow setting ActiveResource::Base#format before #site. [rick]
14
c54b915 @technoweenie Support agnostic formats when calling custom methods. Closes #10635 […
technoweenie authored Dec 28, 2007
15 * Support agnostic formats when calling custom methods. Closes #10635 [joerichsen]
16
470fc02 @jeremy Document custom methods. Closes #10589.
jeremy authored Dec 21, 2007
17 * Document custom methods. #10589 [Cheah Chu Yeow]
18
a1ec3aa @jeremy Ruby 1.9 compatibility
jeremy authored Dec 21, 2007
19 * Ruby 1.9 compatibility. [Jeremy Kemper]
20
21
69edebf @dhh Prepare for 2.0.2 release
dhh authored Dec 16, 2007
22 *2.0.2* (December 16th, 2007)
c81fff2 @jeremy Correct empty response handling. Closes #10445.
jeremy authored Dec 10, 2007
23
1ceccde @dhh Added more specific exceptions for 400, 401, and 403 (all descending …
dhh authored Dec 14, 2007
24 * Added more specific exceptions for 400, 401, and 403 (all descending from ClientError so existing rescues will work) #10326 [trek]
25
c81fff2 @jeremy Correct empty response handling. Closes #10445.
jeremy authored Dec 10, 2007
26 * Correct empty response handling. #10445 [seangeo]
27
28
1acd54a @dhh Make ready for 2.0.1
dhh authored Dec 7, 2007
29 *2.0.1* (December 7th, 2007)
54a75de @dhh Prep for RC2
dhh authored Nov 29, 2007
30
24e6cbc @technoweenie Don't cache net/http object so that ActiveResource is more thread-saf…
technoweenie authored Nov 19, 2007
31 * Don't cache net/http object so that ActiveResource is more thread-safe. Closes #10142 [kou]
32
7863c4a Update XML documentation examples to include explicit type attributes…
Marcel Molina authored Nov 6, 2007
33 * Update XML documentation examples to include explicit type attributes. Closes #9754 [hasmanyjosh]
34
dc399b9 @dhh Added ActiveResource.format= which defaults to :xml but can also be s…
dhh authored Sep 20, 2007
35 * Added one-off declarations of mock behavior [DHH]. Example:
36
37 Before:
38 ActiveResource::HttpMock.respond_to do |mock|
39 mock.get "/people/1.xml", {}, "<person><name>David</name></person>"
40 end
41
42 Now:
43 ActiveResource::HttpMock.respond_to.get "/people/1.xml", {}, "<person><name>David</name></person>"
44
45 * Added ActiveResource.format= which defaults to :xml but can also be set to :json [DHH]. Example:
46
47 class Person < ActiveResource::Base
48 self.site = "http://app/"
49 self.format = :json
50 end
51
52 person = Person.find(1) # => GET http://app/people/1.json
53 person.name = "David"
54 person.save # => PUT http://app/people/1.json {name: "David"}
55
56 Person.format = :xml
57 person.name = "Mary"
58 person.save # => PUT http://app/people/1.json <person><name>Mary</name></person>
59
e682fee @jeremy Fix reload error when path prefix is used. Closes #8727.
jeremy authored Jun 22, 2007
60 * Fix reload error when path prefix is used. #8727 [Ian Warshak]
61
fde3d9d @jeremy Remove ActiveResource::Struct because it hasn't proven very useful. C…
jeremy authored Jun 9, 2007
62 * 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]
63
bfda4cd Fixed query methods on resources. [Cody Fauser]
Tobias Lütke authored Jun 8, 2007
64 * Fix query methods on resources. [Cody Fauser]
65
4d1c87a @technoweenie pass the prefix_options to the instantiated record when using find wi…
technoweenie authored Jun 1, 2007
66 * pass the prefix_options to the instantiated record when using find without a specific id. Closes #8544 [alloy]
67
849038e @jeremy Recognize and raise an exception on 405 Method Not Allowed responses.…
jeremy authored May 26, 2007
68 * Recognize and raise an exception on 405 Method Not Allowed responses. #7692 [Josh Peek]
69
0873678 @technoweenie Handle string and symbol param keys when splitting params into prefix…
technoweenie authored May 9, 2007
70 * Handle string and symbol param keys when splitting params into prefix params and query params.
71
72 Comment.find(:all, :params => { :article_id => 5, :page => 2 }) or Comment.find(:all, :params => { 'article_id' => 5, :page => 2 })
73
04fd94d @dhh BACKWARDS INCOMPATIBLE: Changed the finder API to be more extensible …
dhh authored May 1, 2007
74 * Added find-one with symbol [DHH]. Example: Person.find(:one, :from => :leader) # => GET /people/leader.xml
75
76 * BACKWARDS INCOMPATIBLE: Changed the finder API to be more extensible with :params and more strict usage of scopes [DHH]. Changes:
77
78 Person.find(:all, :title => "CEO") ...becomes: Person.find(:all, :params => { :title => "CEO" })
79 Person.find(:managers) ...becomes: Person.find(:all, :from => :managers)
80 Person.find("/companies/1/manager.xml") ...becomes: Person.find(:one, :from => "/companies/1/manager.xml")
81
82 * Add support for setting custom headers per Active Resource model [Rick]
bd50d82 @technoweenie Add support for setting custom headers per ActiveResource model [Rick]
technoweenie authored Apr 29, 2007
83
84 class Project
8e8fd99 @technoweenie change #custom_headers to just #headers [Rick]
technoweenie authored Apr 29, 2007
85 headers['X-Token'] = 'foo'
bd50d82 @technoweenie Add support for setting custom headers per ActiveResource model [Rick]
technoweenie authored Apr 29, 2007
86 end
87
88 # makes the GET request with the custom X-Token header
89 Project.find(:all)
90
1d5c34c @dhh Added find-by-path options to ActiveResource::Base.find [DHH]
dhh authored Apr 27, 2007
91 * Added find-by-path options to ActiveResource::Base.find [DHH]. Examples:
92
93 employees = Person.find(:all, :from => "/companies/1/people.xml") # => GET /companies/1/people.xml
94 manager = Person.find("/companies/1/manager.xml") # => GET /companies/1/manager.xml
95
96
234b0b7 @dhh Added support for using classes from within a single nested module [DHH]
dhh authored Apr 26, 2007
97 * Added support for using classes from within a single nested module [DHH]. Example:
98
99 module Highrise
100 class Note < ActiveResource::Base
101 self.site = "http://37s.sunrise.i:3000"
102 end
103
104 class Comment < ActiveResource::Base
105 self.site = "http://37s.sunrise.i:3000"
106 end
107 end
108
109 assert_kind_of Highrise::Comment, Note.find(1).comments.first
110
111
37e8e35 @dhh Added load_attributes_from_response as a way of loading attributes fr…
dhh authored Apr 26, 2007
112 * Added load_attributes_from_response as a way of loading attributes from other responses than just create [DHH]
113
114 class Highrise::Task < ActiveResource::Base
115 def complete
116 load_attributes_from_response(post(:complete))
117 end
118 end
119
120 ...will set "done_at" when complete is called.
121
122
9b8399f @dhh Added support for calling custom methods #6979 [rwdaigle]
dhh authored Apr 26, 2007
123 * Added support for calling custom methods #6979 [rwdaigle]
124
125 Person.find(:managers) # => GET /people/managers.xml
126 Kase.find(1).post(:close) # => POST /kases/1/close.xml
127
208d12d @technoweenie Remove explicit prefix_options parameter for ActiveResource::Base#ini…
technoweenie authored Apr 24, 2007
128 * Remove explicit prefix_options parameter for ActiveResource::Base#initialize. [Rick]
129 ActiveResource splits the prefix_options from it automatically.
130
131 * Allow ActiveResource::Base.delete with custom prefix. [Rick]
132
133 * Add ActiveResource::Base#dup [Rick]
134
c97f329 @dhh Disregard namespaces from the default element name, so Highrise::Pers…
dhh authored Apr 19, 2007
135 * Fixed constant warning when fetching the same object multiple times [DHH]
136
137 * Added that saves which get a body response (and not just a 201) will use that response to update themselves [DHH]
138
139 * Disregard namespaces from the default element name, so Highrise::Person will just try to fetch from "/people", not "/highrise/people" [DHH]
140
d97456d @jeremy Allow array and hash query parameters. Closes #7756.
jeremy authored Mar 11, 2007
141 * Allow array and hash query parameters. #7756 [Greg Spurrier]
142
1b1ddf1 @jeremy Loading a resource preserves its prefix_options. Closes #7353. Silenc…
jeremy authored Jan 24, 2007
143 * Loading a resource preserves its prefix_options. #7353 [Ryan Daigle]
144
f49e449 @technoweenie Carry over the convenience of #create from ActiveRecord. Closes #7340.…
technoweenie authored Jan 24, 2007
145 * Carry over the convenience of #create from ActiveRecord. Closes #7340. [Ryan Daigle]
146
1bdb14b @technoweenie Increase ActiveResource::Base test coverage. Closes #7173, #7174 [Ric…
technoweenie authored Jan 23, 2007
147 * Increase ActiveResource::Base test coverage. Closes #7173, #7174 [Rich Collins]
148
e00e6a2 @jeremy Interpret 422 Unprocessable Entity as ResourceInvalid. Closes #7097.
jeremy authored Jan 17, 2007
149 * Interpret 422 Unprocessable Entity as ResourceInvalid. #7097 [dkubb]
150
932e7b0 @technoweenie Mega documentation patches. #7025, #7069 [rwdaigle]
technoweenie authored Jan 16, 2007
151 * Mega documentation patches. #7025, #7069 [rwdaigle]
152
2bb33bb @jeremy Base.exists?(id, options) and Base#exists? check whether the resource…
jeremy authored Jan 12, 2007
153 * Base.exists?(id, options) and Base#exists? check whether the resource is found. #6970 [rwdaigle]
154
4e57ac3 @jeremy Query string support. Closes #6855.
jeremy authored Dec 29, 2006
155 * Query string support. [untext, Jeremy Kemper]
156 # GET /forums/1/topics.xml?sort=created_at
157 Topic.find(:all, :forum_id => 1, :sort => 'created_at')
158
c172154 @jeremy Base#==, eql?, and hash methods. == returns true if its argument is i…
jeremy authored Dec 22, 2006
159 * 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]
160
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you c…
jeremy authored Dec 21, 2006
161 * 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 Apr 24, 2007
162 d
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored Dec 13, 2006
163 class BeastResource < ActiveResource::Base
164 self.site = 'http://beast.caboo.se'
165 end
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you c…
jeremy authored Dec 21, 2006
166
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored Dec 13, 2006
167 class Forum < BeastResource
168 # taken from BeastResource
169 # self.site = 'http://beast.caboo.se'
170 end
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you c…
jeremy authored Dec 21, 2006
171
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored Dec 13, 2006
172 class Topic < BeastResource
e6988ef @jeremy Subclasses share superclass site until explicitly set. This way you c…
jeremy authored Dec 21, 2006
173 self.site += '/forums/:forum_id'
011f4e7 @technoweenie Allow subclassed resources to share the site info [Rick]
technoweenie authored Dec 13, 2006
174 end
175
55d4dbb @technoweenie Fix issues with ActiveResource collection handling. Closes #6291. [bm…
technoweenie authored Dec 12, 2006
176 * Fix issues with ActiveResource collection handling. Closes #6291. [bmilekic]
177
1d31a04 Use attr_accessor_with_default to dry up attribute initialization. Re…
Marcel Molina authored Nov 16, 2006
178 * Use attr_accessor_with_default to dry up attribute initialization. References #6538. [Stuart Halloway]
179
9c94438 @jamis Add basic logging support for logging outgoing requests.
jamis authored Oct 23, 2006
180 * Add basic logging support for logging outgoing requests. [Jamis Buck]
181
6c0609f @jamis Add Base.delete for deleting resources without having to instantiate …
jamis authored Oct 6, 2006
182 * Add Base.delete for deleting resources without having to instantiate them first. [Jamis Buck]
183
628838e @jamis Make #save behavior mimic AR::Base#save (true on success, false on fa…
jamis authored Oct 2, 2006
184 * Make #save behavior mimic AR::Base#save (true on success, false on failure). [Jamis Buck]
185
7ac6ed8 @technoweenie Add Basic HTTP Authentication to ActiveResource (closes #6305). [jona…
technoweenie authored Sep 29, 2006
186 * Add Basic HTTP Authentication to ActiveResource (closes #6305). [jonathan]
187
4d63e01 @technoweenie fixed failing tests now that non-GET requests are sent with .xml file…
technoweenie authored Sep 20, 2006
188 * Extracted #id_from_response as an entry point for customizing how a created resource gets its own ID.
189 By default, it extracts from the Location response header.
190
0a84624 @jeremy Optimistic locking: raise ActiveResource::ResourceConflict on 409 Con…
jeremy authored Sep 9, 2006
191 * Optimistic locking: raise ActiveResource::ResourceConflict on 409 Conflict response. [Jeremy Kemper]
192
193 # Example controller action
194 def update
195 @person.save!
196 rescue ActiveRecord::StaleObjectError
197 render :xml => @person.reload.to_xml, :status => '409 Conflict'
198 end
199
8d9e660 @technoweenie Basic validation support [Rick Olson]
technoweenie authored Sep 8, 2006
200 * Basic validation support [Rick Olson]
201
202 Parses the xml response of ActiveRecord::Errors#to_xml with a similar interface to ActiveRecord::Errors.
203
204 render :xml => @person.errors.to_xml, :status => '400 Validation Error'
205
c918fbf @jeremy Deep hashes are converted into collections of resources. Class attrib…
jeremy authored Sep 4, 2006
206 * Deep hashes are converted into collections of resources. [Jeremy Kemper]
207 Person.new :name => 'Bob',
208 :address => { :id => 1, :city => 'Portland' },
209 :contacts => [{ :id => 1 }, { :id => 2 }]
210 Looks for Address and Contact resources and creates them if unavailable.
211 So clients can fetch a complex resource in a single request if you e.g.
212 render :xml => @person.to_xml(:include => [:address, :contacts])
213 in your controller action.
214
7749c9c @technoweenie Major updates to ActiveResource, please see changelog and unit tests …
technoweenie authored Sep 1, 2006
215 * Major updates [Rick Olson]
216
217 * Add full support for find/create/update/destroy
218 * Add support for specifying prefixes.
219 * Allow overriding of element_name, collection_name, and primary key
220 * Provide simpler HTTP mock interface for testing
221
222 # rails routing code
223 map.resources :posts do |post|
224 post.resources :comments
225 end
226
227 # ActiveResources
228 class Post < ActiveResource::Base
229 self.site = "http://37s.sunrise.i:3000/"
230 end
231
232 class Comment < ActiveResource::Base
233 self.site = "http://37s.sunrise.i:3000/posts/:post_id/"
234 end
235
236 @post = Post.find 5
237 @comments = Comment.find :all, :post_id => @post.id
238
239 @comment = Comment.new({:body => 'hello world'}, {:post_id => @post.id})
240 @comment.save
241
f9b3694 @jeremy 200...400 are valid response codes. PUT and POST request bodies defau…
jeremy authored Aug 31, 2006
242 * 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 Aug 31, 2006
243
8261f17 @jeremy start an Active Resource changelog
jeremy authored Aug 26, 2006
244 * Initial checkin: object-oriented client for restful HTTP resources which follow the Rails convention. [DHH]
Something went wrong with that request. Please try again.