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_course_achievement_metho...

13 lines
521 B

6 years ago
class EcCourseAchievementMethod < ApplicationRecord
belongs_to :ec_course
belongs_to :ec_course_target
belongs_to :ec_course_evaluation
has_many :ec_achievement_evaluation_relates, dependent: :delete_all
has_many :ec_course_evaluation_subitems, through: :ec_achievement_evaluation_relates
validates :percentage, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 100 }
accepts_nested_attributes_for :ec_achievement_evaluation_relates, allow_destroy: true
end