|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
# TODO:: change table column :weigths => :weight
|
|
|
|
|
class EcCourseTarget < ApplicationRecord
|
|
|
|
|
belongs_to :ec_course
|
|
|
|
|
|
|
|
|
@ -8,6 +7,8 @@ class EcCourseTarget < ApplicationRecord
|
|
|
|
|
has_many :ec_course_achievement_methods, dependent: :destroy
|
|
|
|
|
has_many :ec_achievement_evaluation_relates, dependent: :destroy
|
|
|
|
|
|
|
|
|
|
alias_attribute :weight, :weigths
|
|
|
|
|
|
|
|
|
|
validates :content, presence: true
|
|
|
|
|
validates :standard_grade, numericality: { only_integer: true, greater_than: 0 }
|
|
|
|
|
validates :weight, presence: true, numericality: { less_than_or_equal_to: 1, greater_than_or_equal_to: 0 }
|
|
|
|
|