Class: WikiContent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commentsObject

Returns the value of attribute comments


23
24
25
# File 'app/models/wiki_content.rb', line 23

def comments
  @comments
end

Instance Method Details

#activity_typeObject


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

def activity_type
  'wiki_edits'
end

#attachmentsObject


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

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

#projectObject


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

def project
  page.project
end

#recipientsObject

Returns the mail adresses of users that should be notified


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

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

#versionObject


62
63
64
# File 'app/models/wiki_content.rb', line 62

def version
  new_record? ? 0 : last_journal.version
end

#versionsObject

FIXME: Deprecate


58
59
60
# File 'app/models/wiki_content.rb', line 58

def versions
  journals
end

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

Returns:

  • (Boolean)

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

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