Skip to content

Instantly share code, notes, and snippets.

@liwh
Created July 22, 2010 02:33
Show Gist options
  • Save liwh/485485 to your computer and use it in GitHub Desktop.
Save liwh/485485 to your computer and use it in GitHub Desktop.
app/models/department_duties.rb
class DepartmentDuties < ActiveRecord::Base
include UuidHelper
index :id
belongs_to :department, :class_name => "Department"
#创建人,修改人
belongs_to :creator, :class_name => "User"
belongs_to :modifier, :class_name => "User"
end
spec/fixtures/department_duties.yml
jiedao:
leader: 街道小李
manager: 街道小王
department: depart_xilijiedaoban
db/migrate/20100720073056_create_department_duties.rb
class CreateDepartmentDuties<ActiveRecord::Migration
def self.up
create_table :department_duties, :id => false do |t|
t.string :id, :null => false, :unique => true, :primary => true, :limit => 36, :comment => "主键"
t.string :department_id, :limit => 36,:null => false, :comment => "关联部门号"
#t.integer :site, :limit=>10, :comment => "坐席号"
t.string :leader, :limit=>10, :comment => "值班科长"
t.string :manager, :limit=>10, :comment => "值班领导"
#t.string :watchman, :limit => 10, :comment => "接报人"
t.string :creator_id, :limit => 36, :null => false, :comment => "创建人"
t.string :modifier_id, :limit => 36, :null => false, :comment => "最后修改人"
t.timestamps
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment