From 4db17c2aa3ac002bf926facd7d95d87cbb372f9f Mon Sep 17 00:00:00 2001 From: Matt Larraz Date: Thu, 31 Aug 2023 20:20:22 -0400 Subject: [PATCH] Use paranoia_destroyed\? instead of deleted\? (#545) deleted\? might be overridden by other gems, better to use the namespaced method --- lib/paranoia.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/paranoia.rb b/lib/paranoia.rb index 6fc464a5..d6fb1c33 100644 --- a/lib/paranoia.rb +++ b/lib/paranoia.rb @@ -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| @@ -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