Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-04-11 12:02:52 +0400
committerMarin Jankovski <marin@gitlab.com>2014-04-11 12:02:52 +0400
commit872482678be0eef25191e118b8300112735f0023 (patch)
tree69a35c8780186490da6908c304c20ed52cd6a7ce /app/models/wiki_page.rb
parent415c0f4bbe12dbd78bf24d50e66e3092df07fa21 (diff)
Speed up loading and add pagination to wiki pages page.
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 431c1e33f55..c149f40a723 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -57,12 +57,16 @@ class WikiPage
# The raw content of this page.
def content
- @attributes[:content]
+ @attributes[:content] ||= if @page
+ @page.raw_data
+ end
end
# The processed/formatted content of this page.
def formatted_content
- @attributes[:formatted_content]
+ @attributes[:formatted_content] ||= if @page
+ @page.formatted_data
+ end
end
# The markup format for the page.
@@ -163,8 +167,6 @@ class WikiPage
def set_attributes
attributes[:slug] = @page.escaped_url_path
attributes[:title] = @page.title
- attributes[:content] = @page.raw_data
- attributes[:formatted_content] = @page.formatted_data
attributes[:format] = @page.format
end