Skip to content

Commit

Permalink
No need to stale paranoid_value when destroying fully
Browse files Browse the repository at this point in the history
  • Loading branch information
aymeric-ledorze committed Nov 23, 2020
1 parent 2035b63 commit e0aa8ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/acts_as_paranoid/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def destroy_fully!

@_trigger_destroy_callback = true

stale_paranoid_value
@destroyed = true
freeze
end
Expand Down
7 changes: 7 additions & 0 deletions test/test_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ def test_non_persisted_destroy!
assert_not_nil pt.paranoid_value
end

def test_non_persisted_destroy_fully!
pt = ParanoidTime.new
assert_nil pt.paranoid_value
pt.destroy_fully!
assert_nil pt.paranoid_value
end

def test_removal_not_persisted
assert ParanoidTime.new.destroy
end
Expand Down

0 comments on commit e0aa8ce

Please sign in to comment.