Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use paranoia_destroyed? instead of deleted? #545

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/paranoia.rb
Original file line number Diff line number Diff line change
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
Loading