Commit de21320d authored by Patrick Bajao's avatar Patrick Bajao

Remove requirement for id for #markdown_cache_key

It's not needed anymore as we require `#cache_key` instead.
parent 56d52340
......@@ -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}"
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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