数据迁移文件增加个人动态中的迁移

This commit is contained in:
sw 2015-06-02 10:09:05 +08:00
parent e4046851cf
commit c1d753f634
1 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,13 @@ class AboutHomework < ActiveRecord::Migration
homework.updated_at = bid.updated_on
homework.save
#个人动态
bid.acts.each do |act|
act.act_type = homework.class.to_s
act.act_id = homework.id
act.save
end
#作业附件
bid.attachments.each do |attach|
attach.container = homework