parent
a1dfe13728
commit
465af5e2d3
@ -0,0 +1,7 @@
|
|||||||
|
class CourseActivity < ActiveRecord::Base
|
||||||
|
attr_accessible :user_id, :course_act_id,:course_act_type,:course_id
|
||||||
|
# 虚拟关联
|
||||||
|
belongs_to :act ,:polymorphic => true
|
||||||
|
belongs_to :course
|
||||||
|
belongs_to :user
|
||||||
|
end
|
@ -0,0 +1,15 @@
|
|||||||
|
class AddCourseActivities < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
create_table :course_activities do |t|
|
||||||
|
t.integer :user_id
|
||||||
|
t.integer :course_id
|
||||||
|
t.integer :course_act_id
|
||||||
|
t.string :course_act_type
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
drop_table :course_activities
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue