Class: Topic
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Topic
- Defined in:
- app/models/topic.rb
Instance Method Summary collapse
- #body ⇒ Object
- #dom_id ⇒ Object
- #reader ⇒ Object
- #title ⇒ Object
- #visible_to?(reader = nil) ⇒ Boolean
Instance Method Details
#body ⇒ Object
55 56 57 |
# File 'app/models/topic.rb', line 55 def body posts.first.body end |
#dom_id ⇒ Object
37 38 39 |
# File 'app/models/topic.rb', line 37 def dom_id "topic_#{self.id}" end |
#reader ⇒ Object
51 52 53 |
# File 'app/models/topic.rb', line 51 def reader posts.first.reader end |
#title ⇒ Object
59 60 61 |
# File 'app/models/topic.rb', line 59 def title name end |
#visible_to?(reader = nil) ⇒ Boolean
41 42 43 44 45 46 47 48 49 |
# File 'app/models/topic.rb', line 41 def visible_to?(reader=nil) if forum && !forum.visible_to?(reader) false elsif !reader && !Radiant::Config['forum.public?'] false else true end end |