diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-12 19:13:25 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-06-12 19:13:25 +0000 |
commit | f9ddb562d58ae98bcc69f74396b028cbc8cce0b1 (patch) | |
tree | 8019be9178fb3d14c764c04e3e3a5be955de1385 /app/models/wiki.rb | |
parent | 136cdc765afda57b9be02704e52b27334da42c73 (diff) | |
download | redmine-f9ddb562d58ae98bcc69f74396b028cbc8cce0b1.tar.gz redmine-f9ddb562d58ae98bcc69f74396b028cbc8cce0b1.zip |
Cleanup of finders with :conditions option.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11963 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/wiki.rb')
-rw-r--r-- | app/models/wiki.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/wiki.rb b/app/models/wiki.rb index d58212d68..dabe19a4e 100644 --- a/app/models/wiki.rb +++ b/app/models/wiki.rb @@ -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 |