app/controllers/punch_clocks_controller.rb
def destroy
    @punch_clock = PunchClock.find(params[:id])
    return unless user_is_owner_or_admin_of(@punch_clock, @punch_clock.department)
    if @punch_clock.destroy
      flash[:notice] = "Successfully canceled punch clock."
    else
      flash[:error] = "Could not cancel punch clock."
    end
    redirect_to current_user == @punch_clock.user ? dashboard_path : punch_clocks_path
  end
# Cancels out the punch clock w/o adding time to payform
Cancels out the punch clock w/o adding time to payform
Cancels out the punch clock w / o adding time to payform
def destroy
    @punch_clock = PunchClock.find(params[:id])
    return unless user_is_owner_or_admin_of(@punch_clock, @punch_clock.department)
    if @punch_clock.destroy
      flash[:notice] = "Successfully canceled punch clock."
    else
      flash[:error] = "Could not cancel punch clock."
    end
    redirect_to current_user == @punch_clock.user ? dashboard_path : punch_clocks_path
  end
def destroy @punch_clock = PunchClock . find ( params [ :id ] ) return unless user_is_owner_or_admin_of ( @punch_clock , @punch_clock . department ) if @punch_clock . destroy flash [ :notice ] = "Successfully canceled punch clock." else flash [ :error ] = "Could not cancel punch clock." end redirect_to current_user == @punch_clock . user ? dashboard_path : punch_clocks_path end
Cancels out the punch clock w/o adding time to payform
Cancels out the punch clock w / o adding time to payform