Cleanup of finders with :conditions option.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11963 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+2
-2
@@ -50,10 +50,10 @@ class Wiki < ActiveRecord::Base
|
||||
@page_found_with_redirect = false
|
||||
title = start_page if title.blank?
|
||||
title = Wiki.titleize(title)
|
||||
page = pages.first(:conditions => ["LOWER(title) = LOWER(?)", title])
|
||||
page = pages.where("LOWER(title) = LOWER(?)", title).first
|
||||
if !page && !(options[:with_redirect] == false)
|
||||
# search for a redirect
|
||||
redirect = redirects.first(:conditions => ["LOWER(title) = LOWER(?)", title])
|
||||
redirect = redirects.where("LOWER(title) = LOWER(?)", title).first
|
||||
if redirect
|
||||
page = find_page(redirect.redirects_to, :with_redirect => false)
|
||||
@page_found_with_redirect = true
|
||||
|
||||
Reference in New Issue
Block a user