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: avaliation_recovery_lowest_note.rb
    path of file: ./repos/i-diario/app/models
    
    the code of the file until where you have to start completion: class AvaliationRecoveryLowestNote < ApplicationRecord
  include Audit
  include Stepable
  in
    
  def unique_by_step_and_classroom
    return if recovery_diary_record.blank? || step.blank?

    relation = AvaliationRecoveryLowestNote.by_classroom_id(classroom_id)
                                           .by_discipline_id(discipline_id)
                                           .by_step_id(classroom, step_id)

    relation = relation.where.not(id: id) if persisted?

    if relation.any?
      errors.add(:step_id, :unique_by_step_and_classroom)
    end