Commit Graph

207 Commits

Author SHA1 Message Date
Neeraj Singh
a0621c1086 Better code formatting and proper line numbers for stack traces
[#4596 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-14 12:24:01 -07:00
Santiago Pastorino
903637f5f0 Fixes to_json and to_xml for ActiveResource
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-12 21:02:31 +02:00
Santiago Pastorino
bea3c26833 Make ActiveResource serialize XML correctly when element_name is set.
[#4529]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-12 09:31:36 -07:00
Justin George
731d4392e4 Change event namespace ordering to most-significant first [#4504 state:resolved]
More work still needs to be done on some of these names
(render_template.action_view and render_template!.action_view particularly)
but this allows (for example) /^sql/ to subscribe to all
the various ORMs without further modification

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
Santiago Pastorino
7cd1d37a51 Reuse Active Model serialization in Active Resource. [#2584 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-26 15:00:26 -07:00
Jeremy Kemper
2a6e0f34ad Revert "create option to include_root_in_json for ActiveResource [#2584 state:committed]"
This reverts commits 72f89b5d971b48a133c4c0af56fbeda35d738dae, 137d8e0b2fe9fcc4fdac6cbbd44ca010784e5972.

Should reuse Active Model.

[#2584 state:incomplete]
2010-04-25 21:04:19 -07:00
José Valim
ee309d506c Update versions (otherwise you install a gem from source as beta3 but internally it's beta2) and update CHANGELOG. 2010-04-10 12:17:34 +02:00
Santiago Pastorino
13e00ce606 fix stack trace lines on class_eval
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-09 21:28:49 +02:00
Santiago Pastorino
72f89b5d97 create option to include_root_in_json for ActiveResource [#2584 state:committed] 2010-04-05 17:47:02 -03:00
David Heinemeier Hansson
d868cb4f8a Prep for beta2, depend on latest Bundler 2010-04-01 13:36:45 -07:00
Xavier Noria
76f024ac8d adds missing requires for Object#blank? and Object#present? 2010-03-28 14:15:02 +02:00
Xavier Noria
105f9b8154 adds missing requires for Object#duplicable? 2010-03-28 13:26:13 +02:00
Gaël Deest
753304bd11 Makes ActiveResource work with form_for: - Adds a build' method that can be used instead of new' to load a new, unsaved resource from the remote site, filled with the correct default values. - Adds a persisted?' method that simply returns the opposite value than the new?' method. [#4222 state:resolved] [#4155 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-27 01:40:46 -07:00
José Valim
395d6648ce Move application configuration to the application configuration object, remove railtie_name and engine_name and allow to set the configuration object. 2010-03-26 18:47:55 +01:00
Bryan Helmkamp
a4111bbca0 Update versions of all components to normalize them to new format 2010-03-02 00:32:48 -05:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
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
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
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
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