Commit 0f25822c by John Hawthorn

Add paranoia_destroy!

parent 87f8a0c1
...@@ -71,6 +71,11 @@ module Paranoia ...@@ -71,6 +71,11 @@ module Paranoia
end end
alias_method :destroy, :paranoia_destroy alias_method :destroy, :paranoia_destroy
def paranoia_destroy!
paranoia_destroy ||
raise(ActiveRecord::RecordNotDestroyed.new("Failed to destroy the record", self))
end
def paranoia_delete def paranoia_delete
raise ActiveRecord::ReadOnlyRecord, "#{self.class} is marked as readonly" if readonly? raise ActiveRecord::ReadOnlyRecord, "#{self.class} is marked as readonly" if readonly?
if persisted? 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