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