Redirected Pages are not Wanted Pages
... and should not be listed as such on the "list" pages.
This commit is contained in:
parent
e341d62809
commit
63fde3165e
|
@ -13,7 +13,13 @@ 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)
|
||||||
web.has_page?(page_name) ? LINKED_PAGE : WANTED_PAGE
|
if web.has_page?(page_name)
|
||||||
|
LINKED_PAGE
|
||||||
|
elsif self.page_that_redirects_for(web, page_name)
|
||||||
|
REDIRECTED_PAGE
|
||||||
|
else
|
||||||
|
WANTED_PAGE
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.pages_that_reference(web, page_name)
|
def self.pages_that_reference(web, page_name)
|
||||||
|
|
Loading…
Reference in a new issue