limit wiki pages to 8 posts
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
module PostSets
|
||||
class SearchError < Exception
|
||||
end
|
||||
|
||||
class WikiPage < Post
|
||||
def presenter
|
||||
@presenter ||= ::PostSetPresenters::WikiPage.new(self)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -82,7 +82,7 @@ class WikiPage < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def post_set
|
||||
@post_set ||= PostSets::Post.new(title)
|
||||
@post_set ||= PostSets::WikiPage.new(title)
|
||||
end
|
||||
|
||||
def presenter
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
module PostSetPresenters
|
||||
class WikiPage < Post
|
||||
def posts
|
||||
Thread.current["records_per_page"] = 8
|
||||
@post_set.posts
|
||||
ensure
|
||||
Thread.current["records_per_page"] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user