Commit Graph

200 Commits

Author SHA1 Message Date
Prem Sichanugrist
1d9d9d2d89 Fix tiny version number from '3.0.0beta' to '3.0.0.beta1', so 'rake install' will be run correctly [#3879 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-06 15:51:44 +01:00
David Heinemeier Hansson
79817aa9e7 Move to 3.0.0.beta 2010-02-03 17:29:51 -08:00
Jatinder Singh
e87748869a Use format of ARes rather than content-type of remote errors to load errors.
[#1956 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-01-27 18:27:18 -08:00
José Valim
e548f96b1d Rename plugin_name to railtie_name and engine_name. 2010-01-24 12:23:21 +01:00
José Valim
c8cc8a9872 Moved more configuration away from bootstrap. 2010-01-22 20:44:38 +01:00
José Valim
c0d31ca41b save(false) is gone, use save(:validate => false) instead. 2010-01-17 14:22:34 +01:00
Pratik Naik
dba196cb7f Merge docrails 2010-01-17 03:26:20 +05:30
José Valim
e5a2a9fced Remove URI object from ActiveResource notification, send the :mailer class in AM (like in AP#process_action) and remove locale instrumentation. 2010-01-15 15:57:33 +01:00
José Valim
7f4d8e3fbd Yield the payload notifications for further modification (like adding the result). 2010-01-15 12:24:31 +01:00
José Valim
116df09c3e Add notifications to ActiveResource. 2010-01-14 01:07:03 +01:00
Carl Lerche
ae7ada1fde Some railties cleanup:
* Rename <framework>/rails.rb -> <framework>/railtie.rb
	* Rails::Plugin -> Rails::Railtie
	* Rails::Plugin::Vendored -> Rails::Plugin
2009-12-31 13:12:52 -08:00
Carl Lerche
e749424dfa Rename rails.rb -> rails/all.rb and rails/core.rb -> rails.rb 2009-12-31 13:12:52 -08:00
Carl Lerche
a23f4b6aee Add a /rails.rb for each framework for consistency 2009-12-31 11:57:59 -08:00
Joshua Peek
22752ec27c All ARes modules are safe to defer 2009-12-22 17:36:29 -06:00
Joshua Peek
ace20bd25e Flip deferrable autoload convention 2009-12-22 17:27:37 -06:00
Joshua Peek
bdccffc40e Remove annoying and useless meta comments 2009-12-20 19:04:54 -06:00
Joshua Peek
2e9c775998 Use instance_eval for schema block 2009-12-20 19:04:53 -06:00
Joshua Peek
c0ad3f6cc6 Rename define_schema => schema 2009-12-20 19:04:53 -06:00
Joshua Peek
669c5eec44 Rename SchemaDefinition => Schema 2009-12-20 19:04:53 -06:00
Taryn East
fc9b3e4a45 define_schema for Active Resource
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-12-20 19:04:53 -06:00
Joshua Peek
7ee5843c3c Fully expand relative rails framework paths and make sure we aren't
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Carlhuda
c1304098cc Reorganize autoloads:
* A new module (ActiveSupport::Autoload) is provide that extends
    autoloading with new behavior.
  * All autoloads in modules that have extended ActiveSupport::Autoload
    will be eagerly required in threadsafe environments
  * Autoloads can optionally leave off the path if the path is the same
    as full_constant_name.underscore
  * It is possible to specify that a group of autoloads live under an
    additional path. For instance, all of ActionDispatch's middlewares
    are ActionDispatch::MiddlewareName, but they live under 
    "action_dispatch/middlewares/middleware_name"
  * It is possible to specify that a group of autoloads are all found
    at the same path. For instance, a number of exceptions might all
    be declared there.
  * One consequence of this is that testing-related constants are not
    autoloaded. To get the testing helpers for a given component,
    require "component_name/test_case". For instance, "action_controller/test_case".
  * test_help.rb, which is automatically required by a Rails application's
    test helper, requires the test_case.rb for all active components, so
    this change will not be disruptive in existing or new applications.
2009-12-02 20:01:08 -08:00
Jeremy Kemper
76b2d3e337 Ruby 1.9.2: URI.parse and .decode are deprecated 2009-11-09 05:07:58 -08:00
Jeremy Kemper
6d808cf494 Remove reliance on string access core extension 2009-11-09 04:59:26 -08:00
Jeremy Kemper
b540eca588 Consolidate Object#to_param and #to_query core extensions 2009-11-02 17:50:12 -08:00
pivotal
945d999aad Digest auth option for ActiveResource.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-10-15 10:37:04 +13:00
Chad Woolley
32cea98c3b Ruby 1.9: Fix ActiveResource::ConnectionError#to_s when @response does not respond to #code or #message
Signed-off-by: Carl Lerche <carllerche@mac.com>
2009-10-08 10:45:00 -07:00
Joshua Peek
89630a7c2c Cleanup whitespace introduced in 8377646 and f4f6888 2009-10-02 10:19:30 -05:00
Taryn East
8377646d68 add indifferent access to the attributes
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-02 10:13:40 -05:00
Taryn East
f4f68885ef update_attribute(s) added to Active Resource
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-02 10:13:01 -05:00
Jeremy Kemper
b5dd1b6599 Fix brittle content-type check. [#1956 state:committed] 2009-09-17 11:34:40 -07:00
Jeremy Kemper
8682d76cc9 Revert "Allow frameworks to be required by their gem name"
This has just been confusing. Better to educate than band-aid.

This reverts commit 18a24274ec823ded4ffa29bf33fd3d76816aab7e.
Originally from http://dev.rubyonrails.org/ticket/8845 [drnic]
2009-09-12 02:41:01 -07:00
Joshua Peek
723a47bfb3 Kill AMo observing wrap_with_notifications since ARes was only using it 2009-09-02 11:44:36 -05:00
taryn
ce61a6bd55 Added first/last/all aliases for equivalent find scopes
Just a copy from Active Record (with tests). Each is a warpper function for
the equivalent scoped call to find eg first is a wrapper for find(:first)

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-21 14:49:59 -05:00
taryn
328ba3b333 Added save! which raises ResourceInvalid unless valid?
Similar to Active Record - it will raise ActiveResouce::ResourceInvalid if
the resource is not valid (ie if <tt>valid?</tt> returns false)

However - does not raise ActiveResource::ResourceNotFound if the callbacks
fail (callbacks have not yet been implemented) - it will just try to save
and raise if the callbacks all fail.

This is not ideal behaviour - but will do until we decide to change the
behaviour of save_with_validations to actually raise (rather than catch) the
ResourceInvalid exception.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-19 09:05:02 -05:00
taryn
4dc05bc8a9 Swallow ResourceNotFound error on find_every
Active Record does not explode with RecordNotFound if you go looking for a
collection of objects - it just returns nil. Thus Active Resource should
also not explode.

After all - finding no objects that match a set of conditions is not
exceptional behaviour - unlike looking for a specific object with a given id
(which you'd expect to exist).

I've also added documentation to +find+ to reflect this.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-19 09:04:48 -05:00
taryn
c2f90d6530 Added validations to ActiveResource. Added a smoke test to see if we can add a validation and use it, and add a validates callback and use it.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-19 09:03:17 -05:00
Fabien Jakimowicz
797588543e Add support for errors in JSON format.
[#1956 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:40:20 -07:00
Grzegorz Forysinski
e391c7a97c Ensure ActiveResource#load works with numeric arrays [Grzegorz Forysinski, Elad Meidar]
[#2305 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 23:39:38 +01:00
Jordan Brough
916b18adeb Active Resource recognizes 410 as Resource Gone now [#2316 state:resolved] [Jordan Brough, Jatinder Singh]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 22:56:32 +01:00
Jatinder Singh
1fc1986d6d Make ActiveResource#exists? work [#3020 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 22:24:57 +01:00
Roy Nicholson
3e0951632c Add ability to set SSL options on ARes connections.
[#2370 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 13:24:05 -07:00
Jeremy Kemper
a0caad5255 Setting connection timeout also affects Net::HTTP open_timeout.
[#2947 state:resolved]
2009-08-09 02:28:00 -07:00
Marshall Huss
4d1552810f HTTP proxy support
[#2133 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-08 15:33:55 -07:00
Brendan Schwartz
201387496e Ruby 1.9 compat: fix for SSL in Active Resource
[#1272 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-07 12:24:02 -07:00
Joshua Peek
7c84bbf160 Add wrap_with_notifications helper to AMo observing 2009-07-20 23:57:01 -05:00
Joshua Peek
c863388039 Add observing hooks to ARes 2009-07-11 16:59:11 -05:00
Carl Lerche
db3de78a83 Bump up the version to 3.0.pre 2009-06-30 14:37:12 -07:00
Joshua Peek
1c4d28ba31 Move model naming into ActiveModel 2009-06-17 10:37:39 -05:00
Jeremy Kemper
5b256ac369 Prefer JSON.encode(value) to value.to_json 2009-06-08 19:37:52 -07:00