From d03b45eecf5f2a4c77846a88b3c18dc343256b89 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 6 Sep 2022 08:59:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=96=87=E4=BB=B6=E5=AF=B9=E5=88=86=E6=94=AF=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E8=BF=9B=E8=A1=8C=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/contents/create_form.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/forms/contents/create_form.rb b/app/forms/contents/create_form.rb index 6a0294887..1e1b0f99f 100644 --- a/app/forms/contents/create_form.rb +++ b/app/forms/contents/create_form.rb @@ -3,6 +3,8 @@ class Contents::CreateForm < BaseForm validates :filepath, presence: true + validates :branch, :new_branch, length: { maximum: 50 } + validate :check_branch def check_branch From 5acd45bf85674646af20ab49f68c45bd86973391 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 6 Sep 2022 09:00:05 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/contents/create_form.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/forms/contents/create_form.rb b/app/forms/contents/create_form.rb index 1e1b0f99f..431199c59 100644 --- a/app/forms/contents/create_form.rb +++ b/app/forms/contents/create_form.rb @@ -3,7 +3,7 @@ class Contents::CreateForm < BaseForm validates :filepath, presence: true - validates :branch, :new_branch, length: { maximum: 50 } + validates :new_branch, length: { maximum: 50 }, message: "分支名称过长,仅支持50的长度" validate :check_branch From 632ade9d259fbe1f214adf4cdff12a7a88390d0d Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 6 Sep 2022 09:02:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/contents/create_form.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/forms/contents/create_form.rb b/app/forms/contents/create_form.rb index 431199c59..71709026d 100644 --- a/app/forms/contents/create_form.rb +++ b/app/forms/contents/create_form.rb @@ -3,7 +3,7 @@ class Contents::CreateForm < BaseForm validates :filepath, presence: true - validates :new_branch, length: { maximum: 50 }, message: "分支名称过长,仅支持50的长度" + validates :new_branch, length: { maximum: 50} validate :check_branch From 4878d6662035306a9c8eb8c0db02236b0a13df77 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 6 Sep 2022 09:04:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/contents/create_form.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/forms/contents/create_form.rb b/app/forms/contents/create_form.rb index 71709026d..73341661c 100644 --- a/app/forms/contents/create_form.rb +++ b/app/forms/contents/create_form.rb @@ -3,7 +3,7 @@ class Contents::CreateForm < BaseForm validates :filepath, presence: true - validates :new_branch, length: { maximum: 50} + validates :new_branch, length: { maximum: 50, too_long: "分支名称过长,仅支持%{count}的长度"} validate :check_branch