diff --git a/app/models/course.rb b/app/models/course.rb index 2dfb6ae4..51b11867 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -33,8 +33,9 @@ class Course < ActiveRecord::Base acts_as_attachable :view_permission => :view_files, :delete_permission => :manage_files - validates_presence_of :password, :term + validates_presence_of :password, :term,:name validates_format_of :class_period, :with =>/^[1-9]\d*$/ + validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ after_save :create_board_sync before_destroy :delete_all_members