make pool gallery the default view

This commit is contained in:
r888888888
2014-09-05 16:27:19 -07:00
parent 267df896c6
commit 719343cea5
8 changed files with 14 additions and 10 deletions

View File

@@ -14,9 +14,10 @@ module PostSetPresenters
return template.render("post_sets/blank")
end
posts = ::Post.where(id: pools.map(&:cover_post_id)).to_a.inject({}) {|h, x| h[x.id] = x; h}
pools.each do |pool|
if pool.cover_post_id
post = ::Post.find(pool.cover_post_id)
if post = posts[pool.cover_post_id.to_i]
html << PostPresenter.preview(post, options.merge(:tags => @post_set.tag_string, :raw => @post_set.raw, :pool => pool))
html << "\n"
end