This project is archived and is in readonly mode.

Changeset [328ba3b333777bbc1269cbe0e9f590c845006c9d] by taryn

August 19th, 2009 @ 03:05 PM

Added save! which raises ResourceInvalid unless valid?

Similar to Active Record - it will raise ActiveResouce::ResourceInvalid if the resource is not valid (ie if valid? 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 http://github.com/rails/rails/co...

Committed by taryn

  • M activeresource/lib/active_resource/base.rb
  • M activeresource/test/cases/base_test.rb
  • M activeresource/test/cases/validations_test.rb

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>