Refactor post_approvers_only to approver_only.

Don't duplicate code with post_approvers_only; use the approver_only?
method dynamically defined in `User::Roles.each do ... end`.
This commit is contained in:
evazion
2016-10-14 05:04:40 +00:00
parent d84184b5f1
commit bd6ebceda3
6 changed files with 8 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
module Moderator
module Post
class PostsController < ApplicationController
before_filter :post_approvers_only, :only => [:delete, :undelete, :move_favorites, :ban, :unban, :confirm_delete, :confirm_move_favorites, :confirm_ban]
before_filter :approver_only, :only => [:delete, :undelete, :move_favorites, :ban, :unban, :confirm_delete, :confirm_move_favorites, :confirm_ban]
before_filter :admin_only, :only => [:expunge]
rescue_from ::PostFlag::Error, ::Post::ApprovalError, :with => :rescue_exception