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.
11 lines
549 B
11 lines
549 B
5 years ago
|
class Projects::CreateForm < BaseForm
|
||
|
REPOSITORY_NAME_REGEX = /^(?!_)(?!.*?_$)[a-zA-Z0-9_-]+$/ #只含有数字、字母、下划线不能以下划线开头和结尾
|
||
|
attr_accessor :user_id, :name, :description, :repository_name, :project_category_id,
|
||
|
:project_language_id, :ignore_id, :license_id, :private
|
||
|
|
||
|
validates :user_id, :name, :description,:repository_name,
|
||
|
:project_category_id, :project_language_id, presence: true
|
||
|
validates_format_of :repository_name, with: REPOSITORY_NAME_REGEX, multiline: true
|
||
|
|
||
|
end
|