From cc2443e3af0e20dfd9def81ed59bb56b3e07f3e1 Mon Sep 17 00:00:00 2001 From: Toks Date: Mon, 9 Dec 2013 12:25:16 -0500 Subject: [PATCH] Prevent unnecessary wiki page queries for multi-tag searches --- app/logical/post_sets/post.rb | 4 ++-- app/views/posts/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 9a7ff0e88..975a96b80 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -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 diff --git a/app/views/posts/index.html.erb b/app/views/posts/index.html.erb index 784591434..bff9d0e4b 100644 --- a/app/views/posts/index.html.erb +++ b/app/views/posts/index.html.erb @@ -48,7 +48,7 @@ <%= content_for(:html_header) do %> - <% if @post_set.wiki_page %> + <% if @post_set.has_wiki? %> <% end %> <% end %>