The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

28 lines
574 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. log_action :silence, @account
  9. redirect_to admin_accounts_path
  10. end
  11. def destroy
  12. authorize @account, :unsilence?
  13. @account.update!(silenced: false)
  14. log_action :unsilence, @account
  15. redirect_to admin_accounts_path
  16. end
  17. private
  18. def set_account
  19. @account = Account.find(params[:account_id])
  20. end
  21. end
  22. end