Rename admin proposal notifications controller

To be consistent with all the other controllers dealing with hidden
content, we use the word "hidden" in the controller class.
This commit is contained in:
Javi Martín
2020-06-15 12:02:17 +02:00
parent 539db4398a
commit 438a751599
9 changed files with 24 additions and 24 deletions

View File

@@ -0,0 +1,30 @@
class Admin::HiddenProposalNotificationsController < Admin::BaseController
has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index
before_action :load_proposal, only: [:confirm_hide, :restore]
def index
@proposal_notifications = ProposalNotification.only_hidden
.send(@current_filter)
.order(hidden_at: :desc)
.page(params[:page])
end
def confirm_hide
@proposal_notification.confirm_hide
redirect_with_query_params_to(action: :index)
end
def restore
@proposal_notification.restore
@proposal_notification.ignore_flag
Activity.log(current_user, :restore, @proposal_notification)
redirect_with_query_params_to(action: :index)
end
private
def load_proposal
@proposal_notification = ProposalNotification.with_hidden.find(params[:id])
end
end