Class: WikiContent
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- WikiContent
- Defined in:
- app/models/wiki_content.rb
Defined Under Namespace
Classes: Version
Instance Method Summary collapse
- #attachments ⇒ Object
-
#current_version? ⇒ Boolean
Return true if the content is the current page content.
- #notified_users ⇒ Object
- #project ⇒ Object
-
#recipients ⇒ Object
Returns the mail addresses of users that should be notified.
- #visible?(user = User.current) ⇒ Boolean
Instance Method Details
#attachments ⇒ Object
42 43 44 |
# File 'app/models/wiki_content.rb', line 42 def page.nil? ? [] : page. end |
#current_version? ⇒ Boolean
Return true if the content is the current page content
56 57 58 |
# File 'app/models/wiki_content.rb', line 56 def current_version? true end |
#notified_users ⇒ Object
46 47 48 |
# File 'app/models/wiki_content.rb', line 46 def notified_users project.notified_users.reject {|user| !visible?(user)} end |
#project ⇒ Object
38 39 40 |
# File 'app/models/wiki_content.rb', line 38 def project page.project end |
#recipients ⇒ Object
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
34 35 36 |
# File 'app/models/wiki_content.rb', line 34 def visible?(user=User.current) page.visible?(user) end |