From 63a84f990ebbeff52824cecf418dfd5310dae082 Mon Sep 17 00:00:00 2001 From: shizm Date: Wed, 13 Jul 2016 16:59:51 +0900 Subject: [PATCH] Add paranoia_destroy_attributes support for really_destory! --- lib/paranoia.rb | 2 +- test/paranoia_test.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/paranoia.rb b/lib/paranoia.rb index 489d2d62..51b49fe1 100644 --- a/lib/paranoia.rb +++ b/lib/paranoia.rb @@ -143,7 +143,7 @@ def really_destroy! association_data.really_destroy! end end - write_attribute(paranoia_column, current_time_from_proper_timezone) + assign_attributes(paranoia_destroy_attributes) destroy_without_paranoia end end diff --git a/test/paranoia_test.rb b/test/paranoia_test.rb index a1bceeee..fbbf2cfa 100644 --- a/test/paranoia_test.rb +++ b/test/paranoia_test.rb @@ -489,6 +489,12 @@ def test_really_destroy refute ParanoidModel.unscoped.exists?(model.id) end + def test_really_destroy_for_active_column_model + model = ActiveColumnModel.create + model.really_destroy! + refute ActiveColumnModel.unscoped.exists?(model.id) + end + def test_real_destroy_dependent_destroy parent = ParentModel.create child1 = parent.very_related_models.create