# HG changeset patch # User jittat # Date 2008-04-17 15:51:28 # Node ID 72b79959858724dd7a6d88904a6a0045fe4fe282 # Parent c175b74a31f03352454935f55599b871c3adedaa [web] forgot migration git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@182 6386c4cd-e34a-4fa8-8920-d93eb39b512e diff --git a/db/migrate/029_add_test_allowed_to_problems.rb b/db/migrate/029_add_test_allowed_to_problems.rb new file mode 100644 --- /dev/null +++ b/db/migrate/029_add_test_allowed_to_problems.rb @@ -0,0 +1,15 @@ +class AddTestAllowedToProblems < ActiveRecord::Migration + def self.up + add_column :problems, :test_allowed, :boolean + Problem.reset_column_information + + Problem.find(:all).each do |problem| + problem.test_allowed = true + problem.save + end + end + + def self.down + remove_column :problems, :test_allowed + end +end