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 Aug 1, 2018
1 parent e8e2c3c commit 5627a8b
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 @@ -129,7 +129,6 @@ def destroy_fully!
true
end

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 @@ -83,6 +83,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 5627a8b

Please sign in to comment.