diff --git a/app/models/problem.rb b/app/models/problem.rb --- a/app/models/problem.rb +++ b/app/models/problem.rb @@ -3,6 +3,7 @@ belongs_to :description has_and_belongs_to_many :contests, :uniq => true has_many :test_pairs, :dependent => :delete_all + has_many :testcases, :dependent => :destroy validates_presence_of :name validates_format_of :name, :with => /^\w+$/