aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/callbacks_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/callbacks_test.rb')
-rw-r--r--activerecord/test/cases/callbacks_test.rb24
1 files changed, 14 insertions, 10 deletions
diff --git a/activerecord/test/cases/callbacks_test.rb b/activerecord/test/cases/callbacks_test.rb
index dc7f82b001..7f4d25790b 100644
--- a/activerecord/test/cases/callbacks_test.rb
+++ b/activerecord/test/cases/callbacks_test.rb
@@ -16,6 +16,7 @@ class CallbackDeveloper < ActiveRecord::Base
define_method(callback_method) do
self.history << [callback_method, :method]
end
+ send(callback_method, :"#{callback_method}")
end
def callback_object(callback_method)
@@ -27,15 +28,13 @@ class CallbackDeveloper < ActiveRecord::Base
end
end
- ActiveSupport::Deprecation.silence do
- ActiveRecord::Callbacks::CALLBACKS.each do |callback_method|
- next if callback_method.to_s =~ /^around_/
- define_callback_method(callback_method)
- send(callback_method, callback_string(callback_method))
- send(callback_method, callback_proc(callback_method))
- send(callback_method, callback_object(callback_method))
- send(callback_method) { |model| model.history << [callback_method, :block] }
- end
+ ActiveRecord::Callbacks::CALLBACKS.each do |callback_method|
+ next if callback_method.to_s =~ /^around_/
+ define_callback_method(callback_method)
+ send(callback_method, callback_string(callback_method))
+ send(callback_method, callback_proc(callback_method))
+ send(callback_method, callback_object(callback_method))
+ send(callback_method) { |model| model.history << [callback_method, :block] }
end
def history
@@ -461,7 +460,12 @@ class CallbacksTest < ActiveRecord::TestCase
[ :before_validation, :proc ],
[ :before_validation, :object ],
[ :before_validation, :block ],
- [ :before_validation, :returning_false ]
+ [ :before_validation, :returning_false ],
+ [ :after_rollback, :block ],
+ [ :after_rollback, :object ],
+ [ :after_rollback, :proc ],
+ [ :after_rollback, :string ],
+ [ :after_rollback, :method ],
], david.history
end