From ad97066a450c1f5183f177c8425608d2edeb675a Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 27 Jun 2014 11:42:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=90=8D=E7=A7=B0=E6=9C=89?= =?UTF-8?q?=E6=95=88=E6=80=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/course.rb b/app/models/course.rb index 2dfb6ae44..51b118679 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