You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/models/hack_set.rb

8 lines
337 B

5 years ago
class HackSet < ApplicationRecord
#validates :input, presence: { message: "测试集输入不能为空" }
5 years ago
validates :output, presence: { message: "测试集输出不能为空" }
validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同"
5 years ago
# 编程题测试集
belongs_to :hack
5 years ago
end