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.
12 lines
444 B
12 lines
444 B
class Stage < ApplicationRecord
|
|
include Searchable::Dependents::Stage
|
|
|
|
belongs_to :subject, counter_cache: true
|
|
|
|
has_many :stage_shixuns, -> { order("stage_shixuns.position ASC") }, dependent: :destroy
|
|
has_many :shixuns, :through => :stage_shixuns
|
|
|
|
validates :name, length: { maximum: 60 , too_long: "不能超过60个字符" }
|
|
validates :description, length: { maximum: 1000, too_long: "不能超过1000个字符" }
|
|
end
|