You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: court_dates_controller.rb
    path of file: ./repos/casa/app/controllers
    
    the code of the file until where you have to start completion: class CourtDat
    
  def destroy
    authorize @court_date
    if @court_date.date > Time.now
      @court_date.destroy
      redirect_to casa_case_path(@casa_case), notice: "Court date was successfully deleted."
    else
      redirect_to casa_case_court_date_path(@casa_case, @court_date), notice: "You can delete only future court dates."
    end