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