summaryrefslogtreecommitdiffstats
path: root/app/models/wiki_content.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-28 20:12:03 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-28 20:12:03 +0000
commitb8a924e4e1cb6e73299b8e13b5ee8ec625cda2b7 (patch)
treed96a7548ca164cd6d0ceb190a013c853be921ef3 /app/models/wiki_content.rb
parent744e4357a00780583df556b9d4b5cfb0ad6517dc (diff)
downloadredmine-b8a924e4e1cb6e73299b8e13b5ee8ec625cda2b7.tar.gz
redmine-b8a924e4e1cb6e73299b8e13b5ee8ec625cda2b7.zip
Adds #current_version? method to wiki content.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7972 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/wiki_content.rb')
-rw-r--r--app/models/wiki_content.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb
index b1fe60fec..430e9a50e 100644
--- a/app/models/wiki_content.rb
+++ b/app/models/wiki_content.rb
@@ -45,6 +45,11 @@ class WikiContent < ActiveRecord::Base
notified.collect(&:mail)
end
+ # Return true if the content is the current page content
+ def current_version?
+ true
+ end
+
class Version
belongs_to :page, :class_name => '::WikiPage', :foreign_key => 'page_id'
belongs_to :author, :class_name => '::User', :foreign_key => 'author_id'
@@ -101,6 +106,11 @@ class WikiContent < ActiveRecord::Base
page.project
end
+ # Return true if the content is the current page content
+ def current_version?
+ page.content.version == self.version
+ end
+
# Returns the previous version or nil
def previous
@previous ||= WikiContent::Version.find(:first,