diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-25 18:24:11 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-30 19:19:39 +0300 |
commit | fa9d47f221fff4d75e3c50670aeeac7a3d675f7a (patch) | |
tree | a4011a1da4032cb131f1a53d65569cd8e7c59db9 /app/models/wiki_page.rb | |
parent | 98dd492766e3455d75fcab47a6abfa100d5c859c (diff) |
Migrate fetching wiki page formatted content to Gitaly
Closes gitaly#958
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r-- | app/models/wiki_page.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index bdfef677ef3..e6254183baf 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -107,7 +107,10 @@ class WikiPage # The processed/formatted content of this page. def formatted_content - @attributes[:formatted_content] ||= @page&.formatted_data + # Assuming @page exists, nil formatted_data means we didn't load it + # before hand (i.e. page was fetched by Gitaly), so we fetch it separately. + # If the page was fetched by Gollum, formatted_data would've been a String. + @attributes[:formatted_content] ||= @page&.formatted_data || @wiki.page_formatted_data(@page) end # The markup format for the page. |