Prevent unnecessary wiki page queries for multi-tag searches
This commit is contained in:
@@ -19,11 +19,11 @@ module PostSets
|
||||
end
|
||||
|
||||
def has_wiki?
|
||||
tag_array.size == 1 && ::WikiPage.titled(tag_string).exists?
|
||||
is_single_tag? && ::WikiPage.titled(tag_string).exists?
|
||||
end
|
||||
|
||||
def wiki_page
|
||||
if tag_array.any?
|
||||
if is_single_tag?
|
||||
::WikiPage.titled(tag_string).first
|
||||
else
|
||||
nil
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<%= content_for(:html_header) do %>
|
||||
<link href="<%= posts_path(:format => 'atom', :tags => params[:tags]) %>" rel="alternate" title="ATOM" type="application/atom+xml" />
|
||||
<% if @post_set.wiki_page %>
|
||||
<% if @post_set.has_wiki? %>
|
||||
<meta name="description" content="<%= @post_set.wiki_page.presenter.blurb %>"></meta>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user