Commit Graph

12 Commits

Author SHA1 Message Date
GitLab Bot 3a8d221b7e Add latest changes from gitlab-org/gitlab@master 2023-06-22 15:09:14 +00:00
GitLab Bot 40fb10f78e Add latest changes from gitlab-org/gitlab@master 2023-06-17 03:08:18 +00:00
GitLab Bot 96e23b2017 Add latest changes from gitlab-org/gitlab@master 2023-06-05 21:09:04 +00:00
GitLab Bot 4c083c8163 Add latest changes from gitlab-org/gitlab@master 2022-08-19 15:11:58 +00:00
GitLab Bot c9bef85d79 Add latest changes from gitlab-org/gitlab@master 2021-04-19 21:09:27 +00:00
GitLab Bot 05003789d9 Add latest changes from gitlab-org/gitlab@master 2021-04-01 15:08:54 +00:00
GitLab Bot bdca097916 Add latest changes from gitlab-org/gitlab@master 2020-08-11 03:11:00 +00:00
GitLab Bot a4c6555151 Add latest changes from gitlab-org/gitlab@master 2020-07-01 12:09:08 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
Patrick Bajao de21320db2 Remove requirement for id for #markdown_cache_key
It's not needed anymore as we require `#cache_key` instead.
2019-06-05 20:06:41 +08:00
Patrick Bajao 56d52340da Use #cache_key of subject for generated redis key
This commit also includes some changes in specs to use
`Class.new` approach.
2019-06-05 14:36:54 +08:00
Patrick Bajao 2eecfd8f9d Use Redis for CacheMarkDownField on non AR models
This allows using `CacheMarkdownField` for models that are not backed
by ActiveRecord.

When the including class inherits `ActiveRecord::Base` we include
`Gitlab::MarkdownCache::ActiveRecord::Extension`. This will cause the
markdown fields to be rendered and the generated HTML stored in a
`<field>_html` attribute on the record. We also store the version
used for generating the markdown.

All other classes that include this model will include the
`Gitlab::MarkdownCache::Redis::Extension`. This add the `<field>_html`
attributes to that model and will generate the html in them. The
generated HTML will be cached in redis under the key
`markdown_cache:<class>:<id>`. The class this included in must
therefore respond to `id`.
2019-06-05 13:19:59 +08:00