Added the ability to easily rollback to a previous version of a wiki page.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@424 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-04-05 14:45:44 +00:00
parent 7eb4abae80
commit f3a1b4e38c
10 changed files with 17 additions and 2 deletions
+6
View File
@@ -32,6 +32,12 @@ class WikiPage < ActiveRecord::Base
WikiPage.pretty_title(title)
end
def content_for_version(version=nil)
result = content.versions.find_by_version(version.to_i) if version
result ||= content
result
end
def self.pretty_title(str)
(str && str.is_a?(String)) ? str.tr('_', ' ') : str
end