Commit f6448c4a by John Hawthorn

Add paranoia_{delete,destroy} aliases

This should help users be more explicit about what action they want to
perform. My hope is that this will also make it easier to migrate off of
paranoia.
parent c98ad454
......@@ -52,7 +52,7 @@ module Paranoia
end
end
def destroy
def paranoia_destroy
transaction do
run_callbacks(:destroy) do
@_disable_counter_cache = deleted?
......@@ -69,8 +69,9 @@ module Paranoia
end
end
end
alias_method :destroy, :paranoia_destroy
def delete
def paranoia_delete
raise ActiveRecord::ReadOnlyRecord, "#{self.class} is marked as readonly" if readonly?
if persisted?
# if a transaction exists, add the record so that after_commit
......@@ -82,6 +83,7 @@ module Paranoia
end
self
end
alias_method :delete, :paranoia_delete
def restore!(opts = {})
self.class.transaction do
......
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