diff --git a/app/models/course.rb b/app/models/course.rb index ef42d91e8..196e7168d 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -36,7 +36,7 @@ class Course < ActiveRecord::Base acts_as_attachable :view_permission => :view_course_files, :delete_permission => :manage_files - validates_presence_of :password, :term,:name,:description + 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]+$/ validates_length_of :description, :maximum => 10000