rubyforgood/babywearing

View on GitHub
app/controllers/users/deactivate_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Users
  class DeactivateController < ApplicationController
    def create
      user = User.find(params[:id])
      user.deactivated? ? user.activate : user.deactivate

      redirect_back(fallback_location: users_path)
    end
  end
end