aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/new_callbacks_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-09-08 10:10:14 -0500
committerJoshua Peek <josh@joshpeek.com>2009-09-08 10:26:39 -0500
commit4f37b97033f596ec2c95eb53e9964e051c224981 (patch)
treeb7dd859f4d1b1835178eec795711f8619963c23c /activesupport/test/new_callbacks_test.rb
parentaeab739bd56c0bff6d1b5685eee35e557484ab4c (diff)
downloadrails-4f37b97033f596ec2c95eb53e9964e051c224981.tar.gz
rails-4f37b97033f596ec2c95eb53e9964e051c224981.tar.bz2
rails-4f37b97033f596ec2c95eb53e9964e051c224981.zip
Changed ActiveRecord to use new callbacks and speed up observers by only notifying events that are actually being consumed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport/test/new_callbacks_test.rb')
-rw-r--r--activesupport/test/new_callbacks_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/new_callbacks_test.rb b/activesupport/test/new_callbacks_test.rb
index 7e092b5f63..54b278cd56 100644
--- a/activesupport/test/new_callbacks_test.rb
+++ b/activesupport/test/new_callbacks_test.rb
@@ -180,6 +180,10 @@ module NewCallbacksTest
end
end
+ class CleanPerson < ConditionalPerson
+ reset_callbacks :save
+ end
+
class MySuper
include ActiveSupport::NewCallbacks
define_callbacks :save
@@ -349,6 +353,14 @@ module NewCallbacksTest
end
end
+ class ResetCallbackTest < Test::Unit::TestCase
+ def test_save_conditional_person
+ person = CleanPerson.new
+ person.save
+ assert_equal [], person.history
+ end
+ end
+
class CallbackTerminator
include ActiveSupport::NewCallbacks