diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-21 13:16:26 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-21 13:16:26 +0400 |
commit | 625fb2f29d99ab21de2497a36512be69c80e39be (patch) | |
tree | 2ca8f7d92d4974425a67a5288ee79e14bc60e01d /lib/tasks/migrate | |
parent | 0a0b0e1eab251c7e9c9dedc620f14602f8ce3541 (diff) |
Add iids to milestones. Moved iids logic to separate concern
Diffstat (limited to 'lib/tasks/migrate')
-rw-r--r-- | lib/tasks/migrate/migrate_iids.rake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tasks/migrate/migrate_iids.rake b/lib/tasks/migrate/migrate_iids.rake index bc612cd69a7..33271e1a2bb 100644 --- a/lib/tasks/migrate/migrate_iids.rake +++ b/lib/tasks/migrate/migrate_iids.rake @@ -30,4 +30,19 @@ task migrate_iids: :environment do end puts 'done' + puts 'Milestones'.yellow + Milestone.where(iid: nil).find_each(batch_size: 100) do |m| + begin + m.set_iid + if m.update_attribute(:iid, m.iid) + print '.' + else + print 'F' + end + rescue + print 'F' + end + end + + puts 'done' end |