From 83b390bcfcded8bd5263883ddf741ef35bccc801 Mon Sep 17 00:00:00 2001 From: Scott Barron Date: Wed, 28 Sep 2005 00:09:50 +0000 Subject: Returning false in before_destroy should cancel action. Closes #1829. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/callbacks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 8e3aac6e36..fb428c3f31 100755 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -345,9 +345,9 @@ module ActiveRecord return false if result == false end - send(method) if respond_to_without_attributes?(method) + result = send(method) if respond_to_without_attributes?(method) - return true + return result end def callbacks_for(method) -- cgit v1.2.3