|
|
@ -2,7 +2,7 @@ class HackSet < ApplicationRecord
|
|
|
|
validates_length_of :input, maximum: 1000, message: "不能超过1000个字符"
|
|
|
|
validates_length_of :input, maximum: 1000, message: "不能超过1000个字符"
|
|
|
|
validates_length_of :output, maximum: 1000, message: "不能超过1000个字符"
|
|
|
|
validates_length_of :output, maximum: 1000, message: "不能超过1000个字符"
|
|
|
|
#validates :input, presence: { message: "测试集输入不能为空" }
|
|
|
|
#validates :input, presence: { message: "测试集输入不能为空" }
|
|
|
|
validates_presence_of :output, message: "测试集输出不能为空"
|
|
|
|
validates_presence_of :output, message: "不能为空"
|
|
|
|
validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同"
|
|
|
|
validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同"
|
|
|
|
# 编程题测试集
|
|
|
|
# 编程题测试集
|
|
|
|
belongs_to :hack
|
|
|
|
belongs_to :hack
|
|
|
|