course add data
This commit is contained in:
parent
1e7d127998
commit
7dbcc1520c
|
@ -0,0 +1,15 @@
|
|||
class Course < ActiveRecord::Base
|
||||
include Redmine::SafeAttributes
|
||||
|
||||
attr_accessible :code, :extra, :name, :state, :tea_id, :time
|
||||
belongs_to :project, :class_name => 'Project', :foreign_key => :tea_id
|
||||
has_many :bid
|
||||
validates_presence_of :code, :time
|
||||
safe_attributes 'extra',
|
||||
'time',
|
||||
'name',
|
||||
'extra',
|
||||
'code'
|
||||
|
||||
|
||||
end
|
|
@ -0,0 +1,14 @@
|
|||
class CreateCourses < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :courses do |t|
|
||||
t.integer :tea_id
|
||||
t.string :name
|
||||
t.integer :state
|
||||
t.string :code
|
||||
t.integer :time
|
||||
t.string :extra
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue