Commit Graph

2 Commits

Author SHA1 Message Date
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 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