数据迁移

This commit is contained in:
cxt 2016-01-14 09:38:00 +08:00
parent f7a88a63e0
commit 90acb7816f
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ class UpdateForgeAndUserActivity < ActiveRecord::Migration
transaction do
for i in 1 ... user_count do i
UserActivity.page(i).per(30).each do |user_act|
if user_act.act_type = 'Issue'
if user_act.act_type == 'Issue'
if user_act.act
if user_act.act.journals.count > 0
user_act.updated_at = user_act.act.journals.maximum("created_on")
@ -22,7 +22,7 @@ class UpdateForgeAndUserActivity < ActiveRecord::Migration
transaction do
for i in 1 ... for_count do i
ForgeActivity.page(i).per(30).each do |for_act|
if for_act.forge_act_type = 'Issue'
if for_act.forge_act_type == 'Issue'
if for_act.forge_act
if for_act.forge_act.journals.count > 0
for_act.updated_at = for_act.forge_act.journals.maximum("created_on")