Deal with clients that don't send an HTTP_ACCEPT header.

Cache S5, TeX and Print views.
Temporary hack: don't cache list and recently_revised pages.
This commit is contained in:
Jacques Distler 2007-03-08 21:57:21 -06:00
parent d74116dc67
commit a656772622
5 changed files with 10 additions and 9 deletions

View file

@ -40,8 +40,8 @@ class WikiReference < ActiveRecord::Base
def self.pages_in_category(category)
query =
'SELECT name FROM pages JOIN wiki_references ON pages.id = wiki_references.page_id ' +
'WHERE wiki_references.referenced_name = ? ' +
"SELECT name FROM pages JOIN wiki_references ON pages.id = wiki_references.page_id " +
"WHERE wiki_references.referenced_name = ? " +
"AND wiki_references.link_type = '#{CATEGORY}'"
names = connection.select_all(sanitize_sql([query, category])).map { |row| row['name'] }
end
@ -51,7 +51,7 @@ class WikiReference < ActiveRecord::Base
"FROM wiki_references LEFT OUTER JOIN pages " +
"ON wiki_references.page_id = pages.id " +
"WHERE wiki_references.link_type = '#{CATEGORY}' " +
"AND pages.web_id = #{web.id}"
"AND pages.web_id = '#{web.id}'"
connection.select_all(query).map { |row| row['referenced_name'] }
end