Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2009-06-10 21:11:56 -05:00
commit 9f3d3c8607

View file

@ -13,10 +13,8 @@ class WikiReference < ActiveRecord::Base
validates_inclusion_of :link_type, :in => [LINKED_PAGE, WANTED_PAGE, REDIRECTED_PAGE, INCLUDED_PAGE, CATEGORY, AUTHOR, FILE, WANTED_FILE] validates_inclusion_of :link_type, :in => [LINKED_PAGE, WANTED_PAGE, REDIRECTED_PAGE, INCLUDED_PAGE, CATEGORY, AUTHOR, FILE, WANTED_FILE]
def self.link_type(web, page_name) def self.link_type(web, page_name)
if web.has_page?(page_name) if web.has_page?(page_name) || self.page_that_redirects_for(web, page_name)
LINKED_PAGE LINKED_PAGE
elsif self.page_that_redirects_for(web, page_name)
REDIRECTED_PAGE
else else
WANTED_PAGE WANTED_PAGE
end end