Wiki Redirects and Page Renaming

Added the ability to rename existing pages.
[[!redirects Some Page Name]] redirects Wikilinks [[Some Page Name]] to
  the current page (assuming "Some Page Name" does not exist).
  Real pages trump redirects (though this may change, depending on 
  user feedback).
This commit is contained in:
Jacques Distler 2009-06-02 22:17:15 -05:00
parent 634f635f16
commit d7832ba262
16 changed files with 161 additions and 33 deletions

View file

@ -22,8 +22,9 @@ class RevisionSweeper < ActionController::Caching::Sweeper
def expire_caches(page)
expire_cached_summary_pages(page.web)
pages_to_expire = ([page.name] + WikiReference.pages_that_reference(page.web, page.name) +
WikiReference.pages_that_include(page.web, page.name)).uniq
pages_to_expire = ([page.name] + WikiReference.pages_that_reference(page.web, page.name)
+ WikiReference.pages_redirected_to(page.web, page.name)
+ WikiReference.pages_that_include(page.web, page.name)).uniq
pages_to_expire.each { |page_name| expire_cached_page(page.web, page_name) }
end