logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

confirmations_controller.rb (411B)


  1. # frozen_string_literal: true
  2. module Admin
  3. class ConfirmationsController < BaseController
  4. before_action :set_user
  5. def create
  6. authorize @user, :confirm?
  7. @user.confirm!
  8. log_action :confirm, @user
  9. redirect_to admin_accounts_path
  10. end
  11. private
  12. def set_user
  13. @user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound)
  14. end
  15. end
  16. end