diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-12-12 16:02:54 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-12-12 16:02:54 +0000 |
commit | 2cbfc992c9005ed193b2d547a5537313dbf2ca0e (patch) | |
tree | 27e9b2243c4b0714eba9df88201c1e574a1dfe07 /app/models | |
parent | d673628de003d1ce1402f03311066339828fb811 (diff) | |
parent | e8ab4d92b410f46ca87d31a1376acd94f90d1dd9 (diff) | |
download | gitlab-ce-2cbfc992c9005ed193b2d547a5537313dbf2ca0e.tar.gz |
Merge branch 'optimize-issues-avoid-noop-empty-cache-updates2' into 'master'
Treat empty markdown and html strings as valid cached text, not missing cacheā¦
See merge request gitlab-org/gitlab-ce!15856
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/cache_markdown_field.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/concerns/cache_markdown_field.rb b/app/models/concerns/cache_markdown_field.rb index 98776eab424..90ad644ce34 100644 --- a/app/models/concerns/cache_markdown_field.rb +++ b/app/models/concerns/cache_markdown_field.rb @@ -85,8 +85,7 @@ module CacheMarkdownField def cached_html_up_to_date?(markdown_field) html_field = cached_markdown_fields.html_field(markdown_field) - cached = cached_html_for(markdown_field).present? && __send__(markdown_field).present? # rubocop:disable GitlabSecurity/PublicSend - return false unless cached + return false if cached_html_for(markdown_field).nil? && !__send__(markdown_field).nil? # rubocop:disable GitlabSecurity/PublicSend markdown_changed = attribute_changed?(markdown_field) || false html_changed = attribute_changed?(html_field) || false |