Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
commit
0233c9b14b
@ -0,0 +1,21 @@
|
||||
class AlterUserActivities < ActiveRecord::Migration
|
||||
def up
|
||||
UserActivity.all.each do |activity|
|
||||
if activity.act_type == 'Message'
|
||||
if activity.act
|
||||
unless activity.act.parent_id.nil?
|
||||
parent_act = UserActivity.where("act_id = #{activity.act.parent.id} and act_type='Message'").first
|
||||
parent_act.created_at = activity.act.parent.children.maximum("created_on")
|
||||
parent_act.save
|
||||
activity.destroy
|
||||
end
|
||||
else
|
||||
activity.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue