]> cat aescling's git repositories - mastodon.git/commitdiff
Assume Glitch::KeywordMute#destroy! works and error out if it doesn't.
authorDavid Yip <yipdw@member.fsf.org>
Tue, 24 Oct 2017 23:56:57 +0000 (18:56 -0500)
committerDavid Yip <yipdw@member.fsf.org>
Tue, 24 Oct 2017 23:56:57 +0000 (18:56 -0500)
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

index c63626acd0e0f390c4acb12b6b8afedbc4cadd81..f79e1b320b78c4956b59332a762da23e169c1ac8 100644 (file)
@@ -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
This page took 0.021805 seconds and 3 git commands to generate.