You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/models/ec_graduation_requirement.rb

14 lines
460 B

6 years ago
class EcGraduationRequirement < ApplicationRecord
default_scope { order(position: :asc) }
6 years ago
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
accepts_nested_attributes_for :ec_graduation_subitems, allow_destroy: true
6 years ago
end