Rails4: replace deprecated find_all_by_* at WikiPage model
git-svn-id: http://svn.redmine.org/redmine/trunk@12533 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8aa22a05f4
commit
95d86daef3
@ -82,7 +82,7 @@ class WikiPage < ActiveRecord::Base
|
|||||||
# Manage redirects if the title has changed
|
# Manage redirects if the title has changed
|
||||||
if !@previous_title.blank? && (@previous_title != title) && !new_record?
|
if !@previous_title.blank? && (@previous_title != title) && !new_record?
|
||||||
# Update redirects that point to the old title
|
# Update redirects that point to the old title
|
||||||
wiki.redirects.find_all_by_redirects_to(@previous_title).each do |r|
|
wiki.redirects.where(:redirects_to => @previous_title).each do |r|
|
||||||
r.redirects_to = title
|
r.redirects_to = title
|
||||||
r.title == r.redirects_to ? r.destroy : r.save
|
r.title == r.redirects_to ? r.destroy : r.save
|
||||||
end
|
end
|
||||||
@ -96,7 +96,7 @@ class WikiPage < ActiveRecord::Base
|
|||||||
|
|
||||||
def remove_redirects
|
def remove_redirects
|
||||||
# Remove redirects to this page
|
# Remove redirects to this page
|
||||||
wiki.redirects.find_all_by_redirects_to(title).each(&:destroy)
|
wiki.redirects.where(:redirects_to => title).each(&:destroy)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pretty_title
|
def pretty_title
|
||||||
|
Loading…
x
Reference in New Issue
Block a user