Commit b85f2fa4 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Clear html cache for a projects milestones

parent ce0102d8
...@@ -107,6 +107,10 @@ module Gitlab ...@@ -107,6 +107,10 @@ module Gitlab
update_column_in_batches(:notes, :note_html, nil) do |table, query| update_column_in_batches(:notes, :note_html, nil) do |table, query|
query.where(table[:project_id].in(project_ids)) query.where(table[:project_id].in(project_ids))
end end
update_column_in_batches(:milestones, :description_html, nil) do |table, query|
query.where(table[:project_id].in(project_ids))
end
end end
def file_storage? def file_storage?
......
...@@ -65,6 +65,16 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase do ...@@ -65,6 +65,16 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase do
expect(note.reload.note_html).to be_nil expect(note.reload.note_html).to be_nil
end end
it 'removes milestone description' do
milestone = create(:milestone,
project: project,
description_html: 'milestone description')
subject.remove_cached_html_for_projects([project.id])
expect(milestone.reload.description_html).to be_nil
end
end end
describe '#rename_path_for_routable' do describe '#rename_path_for_routable' do
......
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