Commit 5b6be565 by Ashwin Hegde

trigger_transactional_callbacks if paranoia destroyed

parent a4da86d0
......@@ -69,7 +69,7 @@ module Paranoia
next unless send(association.reflection.name)
association.decrement_counters
end
@_trigger_update_callback = true
@_trigger_destroy_callback = true
@_disable_counter_cache = false
result
end
......@@ -82,6 +82,10 @@ module Paranoia
raise(ActiveRecord::RecordNotDestroyed.new("Failed to destroy the record", self))
end
def trigger_transactional_callbacks?
super || @_trigger_destroy_callback && paranoia_destroyed?
end
def paranoia_delete
raise ActiveRecord::ReadOnlyRecord, "#{self.class} is marked as readonly" if readonly?
if persisted?
......
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