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 |
@@ -9,7 +9,18 | |||
|
9 | 9 | # |
|
10 | 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 | 25 | create_table "languages", :force => true do |t| |
|
15 | 26 | t.string "name", :limit => 10 |
You need to be logged in to leave comments.
Login now