add dedicated intro post set

This commit is contained in:
r888888888
2013-06-24 16:09:25 -07:00
parent d93c2c3546
commit 28f3d31a51
3 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
module PostSets
class Intro < PostSets::Post
def initialize(tags)
super(tags)
end
def posts
@posts ||= begin
temp = ::Post.tag_match("#{tag_string} fav_count:>3").paginate(page, :search_count => nil, :limit => 6)
temp.all
temp
end
end
end
end

View File

@@ -5,7 +5,7 @@ class IntroPresenter
def each
popular_tags.each do |tag|
yield(tag, PostSets::Post.new(tag, 1, 6))
yield(tag, PostSets::Intro.new(tag))
end
end
end