Remove requirement for id for #markdown_cache_key

It's not needed anymore as we require `#cache_key` instead.
This commit is contained in:
Patrick Bajao 2019-06-05 20:06:37 +08:00
parent 56d52340da
commit de21320db2
4 changed files with 2 additions and 14 deletions

View File

@ -43,9 +43,9 @@ module Gitlab
end
def markdown_cache_key
unless @subject.respond_to?(:id)
unless @subject.respond_to?(:cache_key)
raise Gitlab::MarkdownCache::UnsupportedClassError,
"This class has no id to use for caching"
"This class has no cache_key to use for caching"
end
"markdown_cache:#{@subject.cache_key}"

View File

@ -15,10 +15,6 @@ describe Gitlab::MarkdownCache::Redis::Extension, :clean_gitlab_redis_cache do
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :description
def id
"test-markdown-cache"
end
def cache_key
"cache-key"
end

View File

@ -13,10 +13,6 @@ describe Gitlab::MarkdownCache::Redis::Store, :clean_gitlab_redis_cache do
attr_accessor :field_1, :field_2, :field_1_html, :field_2_html, :cached_markdown_version
def id
'test-redisbacked-store'
end
def cache_key
"cache-key"
end

View File

@ -27,10 +27,6 @@ describe CacheMarkdownField, :clean_gitlab_redis_cache do
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :description
def id
"test-markdown-cache"
end
def cache_key
"cache-key"
end