Mercurial > hg > soundsoftware-site
comparison app/models/.svn/text-base/wiki.rb.svn-base @ 117:af80e5618e9b redmine-1.1
* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 12:53:21 +0000 |
parents | 513646585e45 |
children | cd2282d2aa55 |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 117:af80e5618e9b |
---|---|
43 end | 43 end |
44 | 44 |
45 # find the page with the given title | 45 # find the page with the given title |
46 def find_page(title, options = {}) | 46 def find_page(title, options = {}) |
47 title = start_page if title.blank? | 47 title = start_page if title.blank? |
48 title = Wiki.titleize(title) | 48 title = Wiki.titleize(title).downcase |
49 page = pages.find_by_title(title) | 49 page = pages.first(:conditions => ["LOWER(title) LIKE ?", title]) |
50 if !page && !(options[:with_redirect] == false) | 50 if !page && !(options[:with_redirect] == false) |
51 # search for a redirect | 51 # search for a redirect |
52 redirect = redirects.find_by_title(title) | 52 redirect = redirects.first(:conditions => ["LOWER(title) LIKE ?", title]) |
53 page = find_page(redirect.redirects_to, :with_redirect => false) if redirect | 53 page = find_page(redirect.redirects_to, :with_redirect => false) if redirect |
54 end | 54 end |
55 page | 55 page |
56 end | 56 end |
57 | 57 |