summaryrefslogtreecommitdiffstats
path: root/app/models/wiki_content.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-20 19:10:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-20 19:10:24 +0000
commit31c6ebb31046470d41a625195662dfccdff116c4 (patch)
treeab099bc278f30009158a7afe93a1ca46e9594ef9 /app/models/wiki_content.rb
parent3d5381b24bb488e4e9edd5a9eec2ba8be4de5c63 (diff)
downloadredmine-31c6ebb31046470d41a625195662dfccdff116c4.tar.gz
redmine-31c6ebb31046470d41a625195662dfccdff116c4.zip
Added wiki annotate view. It's accessible for each version from the page history view.
Slight style change: pre-wrap added on file/diff contents. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1020 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/wiki_content.rb')
-rw-r--r--app/models/wiki_content.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb
index d0a48467b..c307beb1d 100644
--- a/app/models/wiki_content.rb
+++ b/app/models/wiki_content.rb
@@ -60,6 +60,14 @@ class WikiContent < ActiveRecord::Base
data
end
end
+
+ # Returns the previous version or nil
+ def previous
+ @previous ||= WikiContent::Version.find(:first,
+ :order => 'version DESC',
+ :include => :author,
+ :conditions => ["wiki_content_id = ? AND version < ?", wiki_content_id, version])
+ end
end
end