You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
498 B

  1. # frozen_string_literal: true
  2. module Admin
  3. class SilencesController < BaseController
  4. before_action :set_account
  5. def create
  6. authorize @account, :silence?
  7. @account.update(silenced: true)
  8. redirect_to admin_accounts_path
  9. end
  10. def destroy
  11. authorize @account, :unsilence?
  12. @account.update(silenced: false)
  13. redirect_to admin_accounts_path
  14. end
  15. private
  16. def set_account
  17. @account = Account.find(params[:account_id])
  18. end
  19. end
  20. end