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.
13 lines
455 B
13 lines
455 B
6 years ago
|
class EcCourseSupport < ApplicationRecord
|
||
|
default_scope { order(position: :asc) }
|
||
|
|
||
|
belongs_to :ec_course
|
||
|
belongs_to :ec_graduation_subitem
|
||
|
# TODO: 将 ec_graduation_subitem_courses 移除,这个表作为关系表
|
||
|
|
||
|
has_one :ec_graduation_requirement_calculation, dependent: :destroy
|
||
|
|
||
|
validates :weights, presence: true, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 1 }
|
||
|
|
||
|
number_display_methods :weights
|
||
|
end
|