Description:
started grader_process
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@54 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r29:cf924ea7dc0a - - 8 files changed: 72 inserted, 1 deleted
@@ -0,0 +1,17 | |||||
|
|
1 | + class GraderProcess < ActiveRecord::Base | ||
|
|
2 | + | ||
|
|
3 | + def self.find_by_ip_and_pid(ip,pid) | ||
|
|
4 | + return GraderProcess.find(:first, | ||
|
|
5 | + :conditions => { | ||
|
|
6 | + :ip => ip, | ||
|
|
7 | + :pid => pid | ||
|
|
8 | + }) | ||
|
|
9 | + end | ||
|
|
10 | + | ||
|
|
11 | + def self.report_active(ip,pid,mode) | ||
|
|
12 | + end | ||
|
|
13 | + | ||
|
|
14 | + def self.report_inactive(ip,pid,mode) | ||
|
|
15 | + end | ||
|
|
16 | + | ||
|
|
17 | + end |
@@ -0,0 +1,16 | |||||
|
|
1 | + class CreateGraderProcesses < ActiveRecord::Migration | ||
|
|
2 | + def self.up | ||
|
|
3 | + create_table :grader_processes do |t| | ||
|
|
4 | + t.column :ip, :string, :limit => 20 | ||
|
|
5 | + t.column :pid, :integer | ||
|
|
6 | + t.column :mode, :string | ||
|
|
7 | + t.column :active, :boolean | ||
|
|
8 | + t.timestamps | ||
|
|
9 | + end | ||
|
|
10 | + add_index :grader_processes, ["ip","pid"] | ||
|
|
11 | + end | ||
|
|
12 | + | ||
|
|
13 | + def self.down | ||
|
|
14 | + drop_table :grader_processes | ||
|
|
15 | + end | ||
|
|
16 | + end |
@@ -0,0 +1,7 | |||||
|
|
1 | + # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
|
2 | + | ||
|
|
3 | + # one: | ||
|
|
4 | + # column: value | ||
|
|
5 | + # | ||
|
|
6 | + # two: | ||
|
|
7 | + # column: value |
@@ -0,0 +1,8 | |||||
|
|
1 | + require File.dirname(__FILE__) + '/../test_helper' | ||
|
|
2 | + | ||
|
|
3 | + class GradersControllerTest < ActionController::TestCase | ||
|
|
4 | + # Replace this with your real tests. | ||
|
|
5 | + def test_truth | ||
|
|
6 | + assert true | ||
|
|
7 | + end | ||
|
|
8 | + end |
@@ -0,0 +1,8 | |||||
|
|
1 | + require File.dirname(__FILE__) + '/../test_helper' | ||
|
|
2 | + | ||
|
|
3 | + class GraderProcessTest < ActiveSupport::TestCase | ||
|
|
4 | + # Replace this with your real tests. | ||
|
|
5 | + def test_truth | ||
|
|
6 | + assert true | ||
|
|
7 | + end | ||
|
|
8 | + end |
@@ -6,13 +6,24 | |||||
|
6 | # to create the application database on another system, you should be using db:schema:load, not running |
|
6 | # to create the application database on another system, you should be using db:schema:load, not running |
|
7 | # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
7 | # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
8 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
8 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
9 | # |
|
9 | # |
|
10 | # It's strongly recommended to check this file into your version control system. |
|
10 | # It's strongly recommended to check this file into your version control system. |
|
11 |
|
11 | ||
|
12 |
- ActiveRecord::Schema.define(:version => 1 |
|
12 | + ActiveRecord::Schema.define(:version => 14) do |
|
|
13 | + | ||
|
|
14 | + create_table "grader_processes", :force => true do |t| | ||
|
|
15 | + t.string "ip", :limit => 20 | ||
|
|
16 | + t.integer "pid" | ||
|
|
17 | + t.string "mode" | ||
|
|
18 | + t.boolean "active" | ||
|
|
19 | + t.datetime "created_at" | ||
|
|
20 | + t.datetime "updated_at" | ||
|
|
21 | + end | ||
|
|
22 | + | ||
|
|
23 | + add_index "grader_processes", ["ip", "pid"], :name => "index_grader_processes_on_ip_and_pid" | ||
|
13 |
|
24 | ||
|
14 | create_table "languages", :force => true do |t| |
|
25 | create_table "languages", :force => true do |t| |
|
15 | t.string "name", :limit => 10 |
|
26 | t.string "name", :limit => 10 |
|
16 | t.string "pretty_name" |
|
27 | t.string "pretty_name" |
|
17 | t.string "ext", :limit => 10 |
|
28 | t.string "ext", :limit => 10 |
|
18 | end |
|
29 | end |
You need to be logged in to leave comments.
Login now