diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-08-02 09:40:32 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:45:17 -0500 |
commit | 5f2e372cf580307843e0fc813f7ddd7e3c0a0906 (patch) | |
tree | 5edbf43e00104784304ed36285c946c9a24a9e3d | |
parent | 486f45a7ee8e7e05d2e53ceb81556d6bc6d8db18 (diff) |
[Command Tags] Unpublish status before destroying
-rw-r--r-- | app/lib/command_tag/processor.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/command_tag/processor.rb b/app/lib/command_tag/processor.rb index a4b8490f7..0c589364d 100644 --- a/app/lib/command_tag/processor.rb +++ b/app/lib/command_tag/processor.rb @@ -65,6 +65,7 @@ class CommandTag::Processor unless (@status.published? && !@status.edited.zero?) || @text.present? execute_statements(:before_destroy) + @status.update(published: false) @status.destroy execute_statements(:after_destroy) end @@ -217,7 +218,10 @@ class CommandTag::Processor end def destroy_status! - @status.destroy unless @status.destroyed? + return if @status.destroyed? + + @status.update(published: false) + @status.destroy end def normalize(text) |