From 64037c67ac008ba8d19d961a87d292e6b81d0c1d Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Fri, 9 Feb 2007 17:44:36 -0600 Subject: [PATCH] Fixed bug in pages_that_reference(page). --- app/models/wiki_reference.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/wiki_reference.rb b/app/models/wiki_reference.rb index c326e8ad..3d1eddd7 100644 --- a/app/models/wiki_reference.rb +++ b/app/models/wiki_reference.rb @@ -19,7 +19,7 @@ class WikiReference < ActiveRecord::Base def self.pages_that_reference(page_name) query = 'SELECT name FROM pages JOIN wiki_references ON pages.id = wiki_references.page_id ' + - 'WHERE wiki_references.referenced_name = ?' + + 'WHERE wiki_references.referenced_name = ? ' + "AND wiki_references.link_type in ('#{LINKED_PAGE}', '#{WANTED_PAGE}', '#{INCLUDED_PAGE}')" names = connection.select_all(sanitize_sql([query, page_name])).map { |row| row['name'] } end