Commit Graph

405 Commits

Author SHA1 Message Date
Ken Mazaika
1bedee5631 ActiveResource validation tests did not test ActiveModel validations. Adjust the test to be done the Rails3 way.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-15 12:04:42 -02:00
Josh Bassett
056be15212 Fixed a bug where ActiveResource::HttpMock would not replace an existing response when passing a block to the respond_to method.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-09 19:25:53 -02:00
Akira Matsuda
78ecb2485e make the example code a bit more accurate 2011-01-29 09:02:54 +09:00
Akira Matsuda
8f24471989 Fix indentation 2011-01-29 08:15:31 +09:00
Santiago Pastorino
9a57a2279e sorry, the CI cannot lie to us anymore (Part II) 2011-01-13 10:55:41 -02:00
Vijay Dev
4038a6bc0f minor fixesin READMEs 2010-12-20 01:07:33 +05:30
raggi
cb1570936d Rakefiles are executables, and rake loads rake, not rakefile code 2010-11-25 06:49:55 +08:00
Josh Kalderimis
d7db6a8873 class inheritable attributes is used no more! all internal use of class inheritable has been changed to class_attribute. class inheritable attributes has been deprecated.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-20 19:40:29 +01:00
Santiago Pastorino
d891ad4e92 Make ARes tests unescape [ and ] 2010-11-18 23:52:17 -02:00
Carl Lerche
ccd2f3ede5 Update the version.rb files to include a PRE part 2010-11-16 17:19:46 -08:00
Xavier Noria
41366cdec6 syncs CHANGELOGs for 3.0.2 in 3-0-stable with the ones in master 2010-11-09 20:56:41 +01:00
Santiago Pastorino
460c4efd71 Merge CHANGELOGs from 3-0-stable 2010-10-18 12:24:41 -02:00
wycats
cc8e386d08 Always pull in version for frameworks (standardize autoload / require / none) 2010-10-10 16:12:04 -07:00
Gaston Ramos
cec6f3fe20 - update documentation
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-07 16:50:47 +02:00
Gaston Ramos
aee043de5a - ActiveResource::HttpMock.respond_to
do not replace the response with the same path but different method
- Fix typo

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-07 16:50:41 +02:00
Gaston Ramos
b9f8501f82 - Fix ActiveResource::HttpMock.respond_to replace the response
if it has the same request

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-07 16:50:34 +02:00
Santiago Pastorino
42fad8c82b PERF: more changes from inject({}) to Hash + map 2010-10-03 15:03:59 -02:00
Aaron Patterson
ef8ce78ba1 changing map and include to find 2010-09-30 11:00:14 -07:00
Neeraj Singh
0495736339 assert on empty array is always true. fixing test. 2010-09-30 23:57:55 +08:00
Emilio Tagua
71acc2737a Move uri parser to AS as URI.parser method to reuse it in AP and ARes. 2010-09-28 11:38:35 +08:00
Matthijs Langenberg
67a838574b Fix broken module namespacing in ActiveResource with Ruby 1.9 [#5699 state:resolved]
Following namespace use case was broken with Ruby 1.9:

  class Author < ActiveRecord::Base
    ...
  end

  module Api
    class Book < ActiveResouce::Base
    end
  end

Let's say XML contains <book><author><name>John</name></author>....

  Api::Book.first.author.class.to_s #=>
    Ruby 1.8.7: "Api::Book::Author" (namespaced, correct),
    Ruby 1.9: "Author" (toplevel, broken)

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-27 23:10:55 +02:00
Gaston Ramos
f85b38a36b - added mock to test ActiveResource::MissingPrefixParam in finder_test 2010-09-27 15:25:44 -03:00
Gaston Ramos
e405dbcb48 - update exceptions documentation 2010-09-27 15:25:39 -03:00
Gaston Ramos
823a8e6e66 - check prefix options in collection_path 2010-09-27 15:25:33 -03:00
Gaston Ramos
9363931f34 - better name for prefix param test case 2010-09-27 15:25:28 -03:00
Gaston Ramos
30fb3638cc - refactoring, move prefix_options check to a custom method 2010-09-27 15:25:23 -03:00
Gaston Ramos
a71e07d61e - elmenth_path raise an ActiveResource::MissingPrefixParam exception when prefix_options does not has all required prefix_options ex: class StreetAddress < ActiveResource::Base self.site = "http://37s.sunrise.i:3000/people/:person_id/" end
StreetAddress.element_path(1)
    # => ActiveResource::MissingPrefixParam
2010-09-27 15:25:16 -03:00
José Valim
e0c344dc49 Fix active_resource assertions. 2010-09-25 17:56:56 +02:00
Jacques Crocker
51f1f550da Allow per Resource format settings
Previously, ActiveResource was using the connection level formatter for get requests. This made it impossible to use custom formatters per resource.

Additionally this commit makes the Connection request methods more consistent. It always returns a Response. The base will then decode it each the response using its format setting.

Merging this commit will allow users to add custom formatters on a per Resource basis. This enables handling pagination responses from the server side, a very common use case that was previously impossible without monkeypatching XmlFormat.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 13:54:09 +02:00
Jacques Crocker
ee5ef67c44 Allow ActiveResource to work with non-generated ids [#5660 state:resolved]
This commit updates new? so that it knows whether or not the record was actually new or not, and doesn't rely solely on the presence of id. This enables the ability to set a custom primary_key that is not autogenerated by the server.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 11:15:40 +02:00
Xavier Noria
8c0c815ba7 resolves rdoc conflict 2010-09-23 22:35:08 +02:00
Emilio Tagua
0876f39088 No need to use inject here.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:03 -03:00
Thiago Pradi
3c9bf6e1dc Exception handling more readable
[#5601 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-19 12:18:51 -07:00
Mike Abner
154081f0f7 make sure a Content-Length header exists and that the response.body is not nil before trying to call methods on it. Rack does not allow HTTP 204 responses to have a content-length header set. [#5038 state:resolved] 2010-09-18 20:49:45 +02:00
Neeraj Singh
39debfc854 test for #5038 2010-09-18 20:49:41 +02:00
Emilio Tagua
f2765a1cb3 Refactor setup methods by extracting them in abstract_unit, remove TODO.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-17 17:03:58 +02:00
Emilio Tagua
a521a3c05a Remove TODO and support all expected attributes.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-17 17:03:51 +02:00
Alexey Mahotkin
dfebdb1b03 Tiny fixes to rdoc 2010-09-16 17:10:36 +04:00
Carlos Antonio da Silva
a18b73b43c Remove all deprecation warnings in activeresource
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 13:38:38 +02:00
José Valim
599e46bf24 Revert "Setup explicit requires for files with exceptions. Removed them from autoloading."
Booting a new Rails application does not work after this commit [#5359 state:open]

This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
2010-09-02 21:11:03 +02:00
Andreas Garnæs
1503e45e2e ActiveModel#to_xml fix (renamed parameter).
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-02 12:55:45 +02:00
Łukasz Strzałkowski
38a421b34d Setup explicit requires for files with exceptions. Removed them from autoloading.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-02 11:54:04 +02:00
Mikel Lindsaar
58d0e2c23c Adding option to ActiveResource to allow you to not reset the previously stored requests and responses by passing false to respond_to 2010-08-29 22:54:19 -07:00
Mikel Lindsaar
a299642293 Updating documentation on ActiveResource HTTP Mock and also adding test coverage 2010-08-29 22:54:19 -07:00
Jeremy Kemper
b861942691 Update CHANGELOGs for 3.0 release and upcoming 3.1 2010-08-29 22:06:48 -07:00
Jeremy Kemper
0d0c46abd1 Clean up CHANGELOGs 2010-08-28 15:45:14 -07:00
Jaime Iniesta
5430f5bd06 lifecycle should be two words, life cycle 2010-08-26 14:23:58 +02:00
Mikel Lindsaar
c1b49f1e18 Make ActiveResource::InvalidRequestError more user friendly
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-08-25 10:00:37 +02:00
Joost Baaij
20333be581 fix broken relative links [#5415 state:committed]
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-08-24 16:20:32 +02:00
David Heinemeier Hansson
21b1f29720 Master is now targeting 3.1.0.beta 2010-08-23 21:44:57 -05:00