diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-04 20:01:57 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-04 20:01:57 +0400 |
commit | 2d75b454ef87a87bff942dc31837687919113468 (patch) | |
tree | 26640730044bad8eb3e55e78b5ff6930b56e0e1d /lib/tasks/migrate | |
parent | e06352979de1a3344d0ab34c5f0ecf7ed73da66f (diff) |
Store diff with line note. It makes possible to see inline notes with proper diff even if MR diff changed
Diffstat (limited to 'lib/tasks/migrate')
-rw-r--r-- | lib/tasks/migrate/migrate_inline_notes.rake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tasks/migrate/migrate_inline_notes.rake b/lib/tasks/migrate/migrate_inline_notes.rake new file mode 100644 index 00000000000..ec338259abc --- /dev/null +++ b/lib/tasks/migrate/migrate_inline_notes.rake @@ -0,0 +1,16 @@ +desc "GITLAB | Migrate inline notes" +task migrate_inline_notes: :environment do + Note.where(noteable_type: 'MergeRequest').find_each(batch_size: 100) do |note| + begin + note.set_diff + if note.save + print '.' + else + print 'F' + end + rescue + print 'F' + end + end +end + |