From 53c2ea1a862787c8cf4f51f47880e31ea03707df Mon Sep 17 00:00:00 2001 From: David Yip Date: Tue, 24 Oct 2017 18:56:57 -0500 Subject: [PATCH] Assume Glitch::KeywordMute#destroy! works and error out if it doesn't. There's nothing useful we can display if the destroy action messes up, so might as well assert it does and complain loudly if it doesn't. --- app/controllers/settings/keyword_mutes_controller.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/controllers/settings/keyword_mutes_controller.rb b/app/controllers/settings/keyword_mutes_controller.rb index c63626acd0..f79e1b320b 100644 --- a/app/controllers/settings/keyword_mutes_controller.rb +++ b/app/controllers/settings/keyword_mutes_controller.rb @@ -33,12 +33,9 @@ class Settings::KeywordMutesController < ApplicationController end def destroy - if @keyword_mute.destroy - redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg') - else - # FIXME - redirect_to settings_keyword_mutes_path, notice: "huh that didn't work right" - end + @keyword_mute.destroy! + + redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg') end def destroy_all