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: school_term_recovery_diary_records_controller.rb
    path of file: ./repos/i-diario/app/controllers
    
    the code of the file until where you have to start completion: class Schoo
    
  def edit
    @school_term_recovery_diary_record = SchoolTermRecoveryDiaryRecord.find(params[:id]).localized
    step_number = @school_term_recovery_diary_record.step_number
    step = steps_fetcher.step(step_number)
    @school_term_recovery_diary_record.step_id = step.try(:id)
    set_options_by_user
    fetch_disciplines_by_classroom

    if @school_term_recovery_diary_record.step_id.blank?
      recorded_at = @school_term_recovery_diary_record.recorded_at
      flash[:alert] = t('errors.general.calendar_step_not_found', date: recorded_at)

      return redirect_to school_term_recovery_diary_records_path
    end