# frozen_string_literal: true

class AgendaDay < ApplicationRecord
  has_many :times, class_name: 'AgendaTime', inverse_of: :day,
                   dependent: :destroy

  validates :label, presence: true

  def name
    "#{label} (#{date})"
  end
end

# frozen_string_literal: true

class AgendaDay < ApplicationRecord
  has_many :times, class_name: 'AgendaTime', inverse_of: :day,
                   dependent: :destroy, foreign_key: :day_id

  validates :label, presence: true

  def name
    "#{label} (#{date})"
  end
end

Add missing foreign_key config for agenda day association
Add missing foreign_key config for agenda day association
