Skip to content

Commit

Permalink
Use paranoia_destroyed\? instead of deleted\? (#545)
Browse files Browse the repository at this point in the history
deleted\? might be overridden by other gems, better to use the namespaced method
  • Loading branch information
mlarraz committed Sep 1, 2023
1 parent 3bdb553 commit 4db17c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/paranoia.rb
Expand Up @@ -60,7 +60,7 @@ def restore(id_or_ids, opts = {})
def paranoia_destroy
with_transaction_returning_status do
result = run_callbacks(:destroy) do
@_disable_counter_cache = deleted?
@_disable_counter_cache = paranoia_destroyed?
result = paranoia_delete
next result unless result && ActiveRecord::VERSION::STRING >= '4.2'
each_counter_cached_associations do |association|
Expand All @@ -73,7 +73,7 @@ def paranoia_destroy
@_disable_counter_cache = false
result
end
raise ActiveRecord::Rollback, "Not destroyed" unless self.deleted?
raise ActiveRecord::Rollback, "Not destroyed" unless paranoia_destroyed?
result
end || false
end
Expand Down

0 comments on commit 4db17c2

Please sign in to comment.