Class: WikiContent

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/wiki_content.rb

Defined Under Namespace

Classes: Version

Instance Method Summary collapse

Instance Method Details

#attachmentsObject


40
41
42
# File 'app/models/wiki_content.rb', line 40

def attachments
  page.nil? ? [] : page.attachments
end

#current_version?Boolean

Return true if the content is the current page content

Returns:

  • (Boolean)

52
53
54
# File 'app/models/wiki_content.rb', line 52

def current_version?
  true
end

#projectObject


36
37
38
# File 'app/models/wiki_content.rb', line 36

def project
  page.project
end

#recipientsObject

Returns the mail addresses of users that should be notified


45
46
47
48
49
# File 'app/models/wiki_content.rb', line 45

def recipients
  notified = project.notified_users
  notified.reject! {|user| !visible?(user)}
  notified.collect(&:mail)
end

#visible?(user = User.current) ⇒ Boolean

Returns:

  • (Boolean)

32
33
34
# File 'app/models/wiki_content.rb', line 32

def visible?(user=User.current)
  page.visible?(user)
end