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/course_list.rb

16 lines
406 B

6 years ago
class CourseList < ApplicationRecord
has_many :courses
has_many :question_banks
has_many :homework_banks
has_many :exercise_banks
has_many :gtask_banks
has_many :gtopic_banks
belongs_to :user
5 years ago
5 years ago
validate :validate_sensitive_string
def validate_sensitive_string
raise("课程名称包含敏感词汇,请重新输入") unless HarmoniousDictionary.clean?(name)
end
6 years ago
end