Class: Collavre::Topic
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ApplicationRecord
- Collavre::Topic
- Defined in:
- app/models/collavre/topic.rb
Instance Method Summary collapse
- #archive! ⇒ Object
- #archived? ⇒ Boolean
-
#set_primary_agent!(agent) ⇒ Object
Sets or replaces the primary agent for this topic.
- #unarchive! ⇒ Object
Instance Method Details
#archive! ⇒ Object
35 36 37 |
# File 'app/models/collavre/topic.rb', line 35 def archive! update!(archived_at: Time.current) end |
#archived? ⇒ Boolean
31 32 33 |
# File 'app/models/collavre/topic.rb', line 31 def archived? archived_at.present? end |
#set_primary_agent!(agent) ⇒ Object
Sets or replaces the primary agent for this topic
27 28 29 |
# File 'app/models/collavre/topic.rb', line 27 def set_primary_agent!(agent) update!(primary_agent: agent) end |
#unarchive! ⇒ Object
39 40 41 |
# File 'app/models/collavre/topic.rb', line 39 def unarchive! update!(archived_at: nil) end |