Class: WikiContent

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

Overview

Since:

  • 0.5.0

Defined Under Namespace

Classes: Version

Instance Method Summary collapse

Instance Method Details

#attachmentsObject

Since:

  • 1.0.0



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)

Since:

  • 1.3.0



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

def current_version?
  true
end

#notified_usersObject

Since:

  • 3.0.0



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

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

#projectObject

Since:

  • 0.9.0



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

Since:

  • 0.9.0



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)

Since:

  • 0.9.0



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

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