app/controllers/employees_controller.rb
def destroy
    authorize! :destroy, @employee
    if @employee != @current_user 
      @employee.destroy 
      flash[:notice] = t(:employee) + t(:deleted)
    else
      flash[:error] = t(:cannot_delete_self)
    end
    redirect_to employees_path 
  end
# Obliterates selected employee with the mighty hammer of Thor and scatters their data like dust  
# to a thousand winds. (Removes employee and all associations)
Obliterates selected employee with the mighty hammer of Thor and scatters their data like dust
to a thousand winds. (Removes employee and all associations)
Obliterates selected employee with the mighty hammer of Thor and scatters their data like dust to a thousand winds . ( Removes employee and all associations )
def destroy
    authorize! :destroy, @employee
    if @employee != @current_user 
      @employee.destroy 
      flash[:notice] = t(:employee) + t(:deleted)
    else
      flash[:error] = t(:cannot_delete_self)
    end
    redirect_to employees_path 
  end
def destroy authorize! :destroy , @employee if @employee != @current_user @employee . destroy flash [ :notice ] = t ( :employee ) + t ( :deleted ) else flash [ :error ] = t ( :cannot_delete_self ) end redirect_to employees_path end
Obliterates selected employee with the mighty hammer of Thor and scatters their data like dust
to a thousand winds.
Obliterates selected employee with the mighty hammer of Thor and scatters their data like dust to a thousand winds .