Commit a4da86d0 by Ashwin Hegde

Fix after commit for rails 6

parent 0600183a
......@@ -69,6 +69,7 @@ module Paranoia
next unless send(association.reflection.name)
association.decrement_counters
end
@_trigger_update_callback = true
@_disable_counter_cache = false
result
end
......
......@@ -131,6 +131,21 @@ class ParanoiaTest < test_framework
assert model.instance_variable_get(:@after_commit_callback_called)
end
def test_destroy_behavior_for_freshly_loaded_plain_models_callbacks
model = CallbackModel.new
model.save
model = CallbackModel.find(model.id)
model.destroy
assert_nil model.instance_variable_get(:@update_callback_called)
assert_nil model.instance_variable_get(:@save_callback_called)
assert_nil model.instance_variable_get(:@validate_called)
assert model.instance_variable_get(:@destroy_callback_called)
assert model.instance_variable_get(:@after_destroy_callback_called)
assert model.instance_variable_get(:@after_commit_callback_called)
end
def test_delete_behavior_for_plain_models_callbacks
model = CallbackModel.new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment