fix: update repository identifier valid

This commit is contained in:
2021-10-14 14:25:00 +08:00
parent 00100e59c4
commit 98a45eb05c
2 changed files with 4 additions and 3 deletions

View File

@@ -1,11 +1,12 @@
class Projects::UpdateForm < BaseForm
attr_accessor :name, :description, :project_category_id, :project_language_id, :private
attr_accessor :name, :description, :project_category_id, :project_language_id, :private, :identifier, :user_id
validates :name, presence: true
validates :name, length: { maximum: 50 }
validates :description, length: { maximum: 200 }
validate do
check_project_category(project_category_id)
check_project_language(project_language_id)
check_repository_name(user_id, identifier) unless identifier.blank?
end
end