Description:
added test_pair model
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r209:491c30075d87 - - 6 files changed: 47 inserted, 1 deleted
@@ -0,0 +1,15 | |||
|
1 | + class CreateTestPairs < ActiveRecord::Migration | |
|
2 | + def self.up | |
|
3 | + create_table :test_pairs do |t| | |
|
4 | + t.integer :problem_id | |
|
5 | + t.text :input | |
|
6 | + t.text :solution | |
|
7 | + | |
|
8 | + t.timestamps | |
|
9 | + end | |
|
10 | + end | |
|
11 | + | |
|
12 | + def self.down | |
|
13 | + drop_table :test_pairs | |
|
14 | + end | |
|
15 | + end |
@@ -0,0 +1,11 | |||
|
1 | + # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | |
|
2 | + | |
|
3 | + one: | |
|
4 | + problem_id: 1 | |
|
5 | + input: MyText | |
|
6 | + solution: MyText | |
|
7 | + | |
|
8 | + two: | |
|
9 | + problem_id: 1 | |
|
10 | + input: MyText | |
|
11 | + solution: MyText |
@@ -0,0 +1,8 | |||
|
1 | + require 'test_helper' | |
|
2 | + | |
|
3 | + class TestPairTest < ActiveSupport::TestCase | |
|
4 | + # Replace this with your real tests. | |
|
5 | + test "the truth" do | |
|
6 | + assert true | |
|
7 | + end | |
|
8 | + end |
@@ -1,9 +1,10 | |||
|
1 | 1 | class Problem < ActiveRecord::Base |
|
2 | 2 | |
|
3 | 3 | belongs_to :description |
|
4 | + has_many :test_pairs | |
|
4 | 5 | |
|
5 | 6 | validates_presence_of :name |
|
6 | 7 | validates_format_of :name, :with => /^\w+$/ |
|
7 | 8 | validates_presence_of :full_name |
|
8 | 9 | |
|
9 | 10 | DEFAULT_TIME_LIMIT = 1 |
@@ -6,13 +6,13 | |||
|
6 | 6 | # to create the application database on another system, you should be using db:schema:load, not running |
|
7 | 7 | # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
8 | 8 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
9 | 9 | # |
|
10 | 10 | # It's strongly recommended to check this file into your version control system. |
|
11 | 11 | |
|
12 |
- ActiveRecord::Schema.define(:version => 20 |
|
|
12 | + ActiveRecord::Schema.define(:version => 20100113094740) do | |
|
13 | 13 | |
|
14 | 14 | create_table "announcements", :force => true do |t| |
|
15 | 15 | t.string "author" |
|
16 | 16 | t.text "body" |
|
17 | 17 | t.boolean "published" |
|
18 | 18 | t.datetime "created_at" |
@@ -152,12 +152,20 | |||
|
152 | 152 | t.integer "submission_id" |
|
153 | 153 | t.datetime "created_at" |
|
154 | 154 | t.integer "status" |
|
155 | 155 | t.datetime "updated_at" |
|
156 | 156 | end |
|
157 | 157 | |
|
158 | + create_table "test_pairs", :force => true do |t| | |
|
159 | + t.integer "problem_id" | |
|
160 | + t.text "input" | |
|
161 | + t.text "solution" | |
|
162 | + t.datetime "created_at" | |
|
163 | + t.datetime "updated_at" | |
|
164 | + end | |
|
165 | + | |
|
158 | 166 | create_table "test_requests", :force => true do |t| |
|
159 | 167 | t.integer "user_id" |
|
160 | 168 | t.integer "problem_id" |
|
161 | 169 | t.integer "submission_id" |
|
162 | 170 | t.string "input_file_name" |
|
163 | 171 | t.string "output_file_name" |
You need to be logged in to leave comments.
Login now