From c6de7653aed02ea7450f66bbd79af8a9d1abb512 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:20:56 +0800 Subject: [PATCH 1/3] 1 --- app/models/hack_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 6afe05663..4f355181d 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord - #validates :input, presence: { message: "测试集输入不能为空" } - validates :output, presence: { message: "测试集输出不能为空" } + validates :input, allow_nil:false, message: "测试集输入不能为空" + validates :output, allow_nil: false, message: "测试集输出不能为空" validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 0d11d2fda87008bd3060b9991a3777fe3c1e2703 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:23:07 +0800 Subject: [PATCH 2/3] 1 --- app/models/hack_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 4f355181d..7571f3b92 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord - validates :input, allow_nil:false, message: "测试集输入不能为空" - validates :output, allow_nil: false, message: "测试集输出不能为空" + validates :input, allow_nil:false + validates :output, allow_nil: false validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack From 606da7f6b2a649794567880fa05ff9e40b96a864 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 26 Dec 2019 15:24:50 +0800 Subject: [PATCH 3/3] 1 --- app/models/hack_set.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/hack_set.rb b/app/models/hack_set.rb index 7571f3b92..6afe05663 100644 --- a/app/models/hack_set.rb +++ b/app/models/hack_set.rb @@ -1,6 +1,6 @@ class HackSet < ApplicationRecord - validates :input, allow_nil:false - validates :output, allow_nil: false + #validates :input, presence: { message: "测试集输入不能为空" } + validates :output, presence: { message: "测试集输出不能为空" } validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" # 编程题测试集 belongs_to :hack