Commit Graph

49 Commits

Author SHA1 Message Date
Jeremy Kemper
c81fff2468 Correct empty response handling. Closes #10445.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 05:53:56 +00:00
David Heinemeier Hansson
1acd54a5b4 Make ready for 2.0.1
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8330 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-07 13:37:13 +00:00
David Heinemeier Hansson
729741a3fa Preparing for release shortly
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8321 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 18:12:48 +00:00
David Heinemeier Hansson
54a75de3ec Prep for RC2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-29 00:27:53 +00:00
Rick Olson
24e6cbc724 Don't cache net/http object so that ActiveResource is more thread-safe. Closes #10142 [kou]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-19 00:06:23 +00:00
Marcel Molina
7863c4a18a Update XML documentation examples to include explicit type attributes. Closes #9754 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8090 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 18:33:45 +00:00
David Heinemeier Hansson
f18356edb7 Updated CHANGELOGs. They need to be filtered for duplicates
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-29 22:18:26 +00:00
David Heinemeier Hansson
dc399b96c8 Added ActiveResource.format= which defaults to :xml but can also be set to :json [DHH]. Added one-off declarations of mock behavior [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7518 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-20 23:18:05 +00:00
Jeremy Kemper
e682fee121 Fix reload error when path prefix is used. Closes #8727.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-22 18:15:40 +00:00
Jeremy Kemper
fde3d9d8e4 Remove ActiveResource::Struct because it hasn't proven very useful. Creating a new ActiveResource::Base subclass is often less code and always clearer. Closes #8612.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6980 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-09 04:42:32 +00:00
Tobias Lütke
bfda4cdc5a Fixed query methods on resources. [Cody Fauser]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6972 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-08 19:32:15 +00:00
Rick Olson
4d1c87a069 pass the prefix_options to the instantiated record when using find without a specific id. Closes #8544 [alloy]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6925 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-01 17:14:14 +00:00
Jeremy Kemper
849038ee51 Recognize and raise an exception on 405 Method Not Allowed responses. Closes #7692.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6864 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 20:57:08 +00:00
Rick Olson
08736788c9 Handle string and symbol param keys when splitting params into prefix params and query params.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6703 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-09 03:51:06 +00:00
David Heinemeier Hansson
04fd94d8f8 BACKWARDS INCOMPATIBLE: Changed the finder API to be more extensible with :params and more strict usage of scopes [DHH] Added find-one with symbol [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6646 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-01 04:48:48 +00:00
Rick Olson
8e8fd99d7f change #custom_headers to just #headers [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6625 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-29 04:46:14 +00:00
Rick Olson
bd50d82f70 Add support for setting custom headers per ActiveResource model [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6624 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-29 03:14:36 +00:00
David Heinemeier Hansson
1d5c34c2c2 Added find-by-path options to ActiveResource::Base.find [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-27 20:54:53 +00:00
David Heinemeier Hansson
234b0b7ca0 Added support for using classes from within a single nested module [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6587 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-26 19:38:16 +00:00
David Heinemeier Hansson
37e8e35c92 Added load_attributes_from_response as a way of loading attributes from other responses than just create [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-26 02:11:16 +00:00
David Heinemeier Hansson
9b8399fb7f Added support for calling custom methods #6979 [rwdaigle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6584 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-26 01:53:01 +00:00
Rick Olson
2df386ad53 why oh why do i always forget to save the changelog
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6569 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-24 16:05:59 +00:00
Rick Olson
208d12d15d Remove explicit prefix_options parameter for ActiveResource::Base#initialize. Allow ActiveResource::Base.delete with custom prefix. Add ActiveResource::Base#dup [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6568 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-24 16:05:20 +00:00
David Heinemeier Hansson
c97f329b2a Disregard namespaces from the default element name, so Highrise::Person will just try to fetch from "/people", not "/highrise/people" [DHH] Added that saves which get a body response (and not just a 201) will use that response to update themselves [DHH] Fixed constant warning when fetching the same object multiple times [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-19 22:18:03 +00:00
Jeremy Kemper
d97456dd82 Allow array and hash query parameters. Closes #7756.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6379 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-11 13:27:57 +00:00
Jeremy Kemper
1b1ddf1736 Loading a resource preserves its prefix_options. Closes #7353. Silence prefix redefinition warnings; fix type in logged error.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6032 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-24 18:27:36 +00:00
Rick Olson
f49e449ed5 Carry over the convenience of #create from ActiveRecord. Closes #7340. [Ryan Daigle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6025 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-24 02:40:32 +00:00
Rick Olson
1bdb14bdd3 Increase ActiveResource::Base test coverage. Closes #7173, #7174 [Rich Collins]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6020 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-23 05:22:33 +00:00
Jeremy Kemper
e00e6a2941 Interpret 422 Unprocessable Entity as ResourceInvalid. Closes #7097.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5967 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-17 00:46:32 +00:00
Rick Olson
932e7b003c Mega documentation patches. #7025, #7069 [rwdaigle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5962 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-16 06:34:10 +00:00
Jeremy Kemper
2bb33bbd59 Base.exists?(id, options) and Base#exists? check whether the resource is found. Closes #6970.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-12 07:20:05 +00:00
Jeremy Kemper
4e57ac3544 Query string support. Closes #6855.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5804 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-29 01:18:09 +00:00
Jeremy Kemper
c172154054 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.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-22 21:42:52 +00:00
Jeremy Kemper
e6988ef2ce Subclasses share superclass site until explicitly set. This way you can set Superclass.site = ... after subclasses have been defined.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-21 22:12:21 +00:00
Rick Olson
011f4e7413 Allow subclassed resources to share the site info [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5717 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-13 02:15:27 +00:00
Rick Olson
55d4dbb8df Fix issues with ActiveResource collection handling. Closes #6291. [bmilekic]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5714 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-12 15:29:54 +00:00
Marcel Molina
1d31a043e0 Use attr_accessor_with_default to dry up attribute initialization. References #6538. [Stuart Halloway]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-16 19:36:50 +00:00
Jamis Buck
9c9443812f Add basic logging support for logging outgoing requests.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5343 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-23 22:21:09 +00:00
Jamis Buck
6c0609fafb Add Base.delete for deleting resources without having to instantiate them first
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-06 17:25:10 +00:00
Jamis Buck
628838ed93 Make #save behavior mimic AR::Base#save (true on success, false on failure)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-02 22:14:15 +00:00
Rick Olson
7ac6ed893f Add Basic HTTP Authentication to ActiveResource (closes #6305). [jonathan]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5208 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-29 16:25:49 +00:00
Rick Olson
4d63e01fa0 fixed failing tests now that non-GET requests are sent with .xml file ext. Extracted #id_from_response as an entry point for customizing how a created resource gets its own ID.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-20 19:31:17 +00:00
Jeremy Kemper
0a84624bd7 Optimistic locking: raise ActiveResource::ResourceConflict on 409 Conflict response.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5078 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-09 00:11:12 +00:00
Rick Olson
8d9e6609f8 Basic validation support [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5068 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-08 00:07:30 +00:00
Jeremy Kemper
c918fbf14b Deep hashes are converted into collections of resources. Class attribute writer methods.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4985 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-04 10:04:23 +00:00
Rick Olson
7749c9c220 Major updates to ActiveResource, please see changelog and unit tests [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-09-01 01:15:10 +00:00
Jeremy Kemper
f9b3694870 200...400 are valid response codes. PUT and POST request bodies default to ''.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4887 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-31 09:31:11 +00:00
Jeremy Kemper
c1af2db14b site= accepts URIs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4886 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-31 07:55:31 +00:00
Jeremy Kemper
8261f17eb8 start an Active Resource changelog
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4826 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-26 08:23:36 +00:00