Use the GitLab version as part of the appearances cache key

This prevents us from having to manually flush the cache key
in migrations every time a new column is added.

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/5571
This commit is contained in:
Stan Hu 2018-04-05 12:52:20 -07:00
parent eaed588bf2
commit d209a05486
2 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class Appearance < ActiveRecord::Base
has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
CACHE_KEY = 'current_appearance'.freeze
CACHE_KEY = "current_appearance:#{Gitlab::VERSION}".freeze
after_commit :flush_redis_cache

View File

@ -0,0 +1,5 @@
---
title: Use the GitLab version as part of the appearances cache key
merge_request:
author:
type: fixed