课程名称有效性判断
This commit is contained in:
parent
c0f0e294e5
commit
ad97066a45
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue