diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-04-25 14:46:13 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-01 11:14:24 +0200 |
commit | b85f2fa4c7dca83d9fabb702562c3b4244231741 (patch) | |
tree | a70931beec12363add81d63738791b6bf1b1d026 | |
parent | ce0102d8b752a57131692d5dec620b50b2e76658 (diff) | |
download | gitlab-ce-b85f2fa4c7dca83d9fabb702562c3b4244231741.tar.gz |
Clear html cache for a projects milestones
-rw-r--r-- | lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb index 7838951c703..de4e6e7c404 100644 --- a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb +++ b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb @@ -107,6 +107,10 @@ module Gitlab update_column_in_batches(:notes, :note_html, nil) do |table, query| query.where(table[:project_id].in(project_ids)) end + + update_column_in_batches(:milestones, :description_html, nil) do |table, query| + query.where(table[:project_id].in(project_ids)) + end end def file_storage? diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb index 7704f1dbead..64bc5fc0429 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb @@ -65,6 +65,16 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase do expect(note.reload.note_html).to be_nil 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 describe '#rename_path_for_routable' do |