mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
[ADD]组织项目相关
This commit is contained in:
@@ -7,7 +7,7 @@ class Projects::CreateForm < BaseForm
|
||||
:project_category_id, :project_language_id, presence: true
|
||||
validates :repository_name, format: { with: REPOSITORY_NAME_REGEX, multiline: true, message: "只能含有数字、字母、下划线且不能以下划线开头和结尾" }
|
||||
|
||||
validate :check_ignore, :check_license
|
||||
validate :check_ignore, :check_license, :check_owner
|
||||
validate do
|
||||
check_project_category(project_category_id)
|
||||
check_project_language(project_language_id)
|
||||
@@ -20,4 +20,8 @@ class Projects::CreateForm < BaseForm
|
||||
def check_ignore
|
||||
raise "ignore_id值无效." if ignore_id && Ignore.find_by(id: ignore_id).blank?
|
||||
end
|
||||
|
||||
def check_owner
|
||||
raise "user_id值无效." if user_id && Owner.find_by(id: user_id).blank?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user