Skip to content

HTTPS clone URL

Subversion checkout URL

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