Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/users/user_organizations.html.erbke_guange
commit
64d4789150
@ -0,0 +1,18 @@
|
||||
class DeleteUselessOrgActivities < ActiveRecord::Migration
|
||||
def up
|
||||
OrgActivity.all.each do |act|
|
||||
if act.container_type == 'Course'
|
||||
if CourseActivity.where("course_act_type=? and course_act_id =? and course_id =?", act.org_act_type, act.org_act_id, act.container_id).count == 0
|
||||
puts "course"
|
||||
end
|
||||
else
|
||||
if act.container_type == 'Project' and ForgeActivity.where("forge_act_type=? and forge_act_id =? and project_id =?", act.org_act_type, act.org_act_id, act.container_id).count == 0
|
||||
act.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in new issue