From 628838ed9349252eccd86b531959c111e285893e Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 2 Oct 2006 22:14:15 +0000 Subject: Make #save behavior mimic AR::Base#save (true on success, false on failure) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activeresource/lib/active_resource/validations.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activeresource/lib/active_resource/validations.rb') diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index f1995a6070..3011ba3295 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -109,8 +109,9 @@ module ActiveResource def save_with_validation save_without_validation - rescue ResourceInvalid - errors.from_xml($!.response.body) + rescue ResourceInvalid => error + errors.from_xml(error.response.body) + return false end def valid? -- cgit v1.2.3