Adds #current_version? method to wiki content.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7972 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user