Commit Graph

13 Commits

Author SHA1 Message Date
Xavier Noria 1979e9c855 Symbol#to_proc is not needed for Ruby >= 1.8.7 2009-11-09 22:16:51 +01: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 6e7b02b21a Fix for Ruby 1.9 - define_method throws an exception under 1.9 if given incorrect number of args
Signed-off-by: Carl Lerche <carllerche@mac.com>
2009-10-08 10:48:47 -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 59d1b23ea1 Fix failing ARes isolated tests 2009-09-05 19:24:43 -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 079ed8fc43 Pulled find-based tests into their own test case. This matches Active Record, and allows us to have one places where all find-tests are located, which will help when adding dynamic finders later.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-19 09:04:14 -05:00
taryn 36bf587347 Moved all test cases into a new test/cases directory to match Active Record test directory structure.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-19 09:03:57 -05:00