test_redirects_removed_when_deleting_page at unit wiki_redirect_test.rb has this test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7437
e93f8b46-1217-0410-a6f0-
8f06a7374b81
validates_associated :content
validate :validate_parent_title
+ before_destroy :remove_redirects
# eager load information about last updates, without loading text
named_scope :with_updated_on, {
end
end
- def before_destroy
+ def remove_redirects
# Remove redirects to this page
wiki.redirects.find_all_by_redirects_to(title).each(&:destroy)
end