refactored with_timeout helper

This commit is contained in:
albert
2013-01-30 15:04:13 -08:00
parent c6d4500c91
commit c6b9de8486
3 changed files with 11 additions and 11 deletions

View File

@@ -6,8 +6,11 @@ module PostSetPresenters
def post_previews_html(template)
html = ""
is_empty = Post.with_timeout(500, false) do
posts.empty?
end
if posts.empty?
if is_empty?
return template.render("post_sets/blank")
end