add dedicated intro post set
This commit is contained in:
15
app/logical/post_sets/intro.rb
Normal file
15
app/logical/post_sets/intro.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user