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



42
43
44
# File 'app/models/wiki_content.rb', line 42

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

#current_version?Boolean

Return true if the content is the current page content

Returns:

  • (Boolean)


56
57
58
# File 'app/models/wiki_content.rb', line 56

def current_version?
  true
end

#notified_usersObject



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

def notified_users
  project.notified_users.reject {|user| !visible?(user)}
end

#projectObject



38
39
40
# File 'app/models/wiki_content.rb', line 38

def project
  page.project
end

#recipientsObject

Returns the mail addresses of users that should be notified



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

def recipients
  notified_users.collect(&:mail)
end

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

Returns:

  • (Boolean)


34
35
36
# File 'app/models/wiki_content.rb', line 34

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