class EcGraduationRequirement < ApplicationRecord
  belongs_to :ec_year

  has_many :ec_graduation_subitems, dependent: :destroy
  has_many :ec_requirement_vs_objectives, dependent: :destroy

  validates :position, presence: true, numericality: { only_integer: true, greater_than: 0 }
  validates :content, presence: true

  default_scope { order(position: :asc) }
end