diff options
author | Nick Thomas <nick@gitlab.com> | 2019-03-13 16:42:43 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-03-13 16:42:43 +0300 |
commit | 9f05e97aad33a0cd70862f67101bdcb3fddc639a (patch) | |
tree | a9868d2c6711ebff1dcbb06f6d09f91d15caa631 /lib/tasks/migrate | |
parent | 5ed9c5f7f74d7305bb884a6ae7a601d4563398a4 (diff) |
Run rubocop -a
Diffstat (limited to 'lib/tasks/migrate')
-rw-r--r-- | lib/tasks/migrate/migrate_iids.rake | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/lib/tasks/migrate/migrate_iids.rake b/lib/tasks/migrate/migrate_iids.rake index aa2d01730d7..cb7c496c31c 100644 --- a/lib/tasks/migrate/migrate_iids.rake +++ b/lib/tasks/migrate/migrate_iids.rake @@ -2,49 +2,43 @@ desc "GitLab | Build internal ids for issues and merge requests" task migrate_iids: :environment do puts 'Issues'.color(:yellow) Issue.where(iid: nil).find_each(batch_size: 100) do |issue| - begin - issue.set_iid + issue.set_iid - if issue.update_attribute(:iid, issue.iid) - print '.' - else - print 'F' - end - rescue + if issue.update_attribute(:iid, issue.iid) + print '.' + else print 'F' end + rescue + print 'F' end puts 'done' puts 'Merge Requests'.color(:yellow) MergeRequest.where(iid: nil).find_each(batch_size: 100) do |mr| - begin - mr.set_iid + mr.set_iid - if mr.update_attribute(:iid, mr.iid) - print '.' - else - print 'F' - end - rescue + if mr.update_attribute(:iid, mr.iid) + print '.' + else print 'F' end + rescue + print 'F' end puts 'done' puts 'Milestones'.color(:yellow) Milestone.where(iid: nil).find_each(batch_size: 100) do |m| - begin - m.set_iid + m.set_iid - if m.update_attribute(:iid, m.iid) - print '.' - else - print 'F' - end - rescue + if m.update_attribute(:iid, m.iid) + print '.' + else print 'F' end + rescue + print 'F' end puts 'done' |