]> cat aescling's git repositories - mastodon.git/commitdiff
Use current_account from ApplicationController.
authorDavid Yip <yipdw@member.fsf.org>
Sun, 22 Oct 2017 06:02:52 +0000 (01:02 -0500)
committerDavid Yip <yipdw@member.fsf.org>
Sun, 22 Oct 2017 06:02:52 +0000 (01:02 -0500)
This avoids copy-pasting definitions of set_account.

app/controllers/settings/keyword_mutes_controller.rb

index 6ae05108d9ca2542b809b6cdd871fb68382e52bf..d64eba88e756a3bd1bd6da6f3870593f51ff9ae2 100644 (file)
@@ -4,7 +4,6 @@ class Settings::KeywordMutesController < ApplicationController
   layout 'admin'
 
   before_action :authenticate_user!
-  before_action :set_account
   before_action :load_keyword_mute, only: [:edit, :update, :destroy]
 
   def index
@@ -50,12 +49,8 @@ class Settings::KeywordMutesController < ApplicationController
 
   private
 
-  def set_account
-    @account = current_user.account
-  end
-
   def keyword_mutes_for_account
-    Glitch::KeywordMute.where(account: @account)
+    Glitch::KeywordMute.where(account: current_account)
   end
 
   def load_keyword_mute
This page took 0.026019 seconds and 3 git commands to generate.