@@ -82,7 +82,7 class WikiPage < ActiveRecord::Base | |||
|
82 | 82 | # Manage redirects if the title has changed |
|
83 | 83 | if !@previous_title.blank? && (@previous_title != title) && !new_record? |
|
84 | 84 | # Update redirects that point to the old title |
|
85 |
wiki.redirects. |
|
|
85 | wiki.redirects.where(:redirects_to => @previous_title).each do |r| | |
|
86 | 86 | r.redirects_to = title |
|
87 | 87 | r.title == r.redirects_to ? r.destroy : r.save |
|
88 | 88 | end |
@@ -96,7 +96,7 class WikiPage < ActiveRecord::Base | |||
|
96 | 96 | |
|
97 | 97 | def remove_redirects |
|
98 | 98 | # Remove redirects to this page |
|
99 |
wiki.redirects. |
|
|
99 | wiki.redirects.where(:redirects_to => title).each(&:destroy) | |
|
100 | 100 | end |
|
101 | 101 | |
|
102 | 102 | def pretty_title |
General Comments 0
You need to be logged in to leave comments.
Login now