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 |
@@ -1,36 +1,47 | |||
|
1 | 1 | # This file is auto-generated from the current state of the database. Instead of editing this file, |
|
2 | 2 | # please use the migrations feature of ActiveRecord to incrementally modify your database, and |
|
3 | 3 | # then regenerate this schema definition. |
|
4 | 4 | # |
|
5 | 5 | # Note that this schema.rb definition is the authoritative source for your database schema. If you need |
|
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 => 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 |
|
16 | 27 | t.string "pretty_name" |
|
17 | 28 | t.string "ext", :limit => 10 |
|
18 | 29 | end |
|
19 | 30 | |
|
20 | 31 | create_table "problems", :force => true do |t| |
|
21 | 32 | t.string "name", :limit => 30 |
|
22 | 33 | t.string "full_name" |
|
23 | 34 | t.integer "full_score" |
|
24 | 35 | t.date "date_added" |
|
25 | 36 | t.boolean "available" |
|
26 | 37 | t.string "url" |
|
27 | 38 | end |
|
28 | 39 | |
|
29 | 40 | create_table "rights", :force => true do |t| |
|
30 | 41 | t.string "name" |
|
31 | 42 | t.string "controller" |
|
32 | 43 | t.string "action" |
|
33 | 44 | end |
|
34 | 45 | |
|
35 | 46 | create_table "rights_roles", :id => false, :force => true do |t| |
|
36 | 47 | t.integer "right_id" |
You need to be logged in to leave comments.
Login now