summaryrefslogtreecommitdiffstats
path: root/app/models/wiki_page.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/wiki_page.rb')
-rw-r--r--app/models/wiki_page.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index e99bb314e..19961cb0b 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -29,6 +29,10 @@ class WikiPage < ActiveRecord::Base
end
def pretty_title
- title.tr '_', ' '
+ WikiPage.pretty_title(title)
+ end
+
+ def self.pretty_title(str)
+ (str && str.is_a?(String)) ? str.tr('_', ' ') : str
end
end