BigW Consortium Gitlab

Commit d3ca12a1 by Dmitriy Zaporozhets

Merge pull request #3911 from babatakao/migrate_note_linecode

Migrate notes.line_code format.
parents 5b5ff770 320f0ac8
desc "GITLAB | Migrate Note LineCode"
task migrate_note_linecode: :environment do
Note.inline.each do |note|
index = note.diff_file_index
if index =~ /^\d{1,10}$/ # is number. not hash.
hash = Digest::SHA1.hexdigest(note.noteable.diffs[index.to_i].new_path)
new_line_code = note.line_code.sub(index, hash)
note.update_column :line_code, new_line_code
print '.'
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment