Class: Collavre::Topic

Inherits:
ApplicationRecord show all
Defined in:
app/models/collavre/topic.rb

Instance Method Summary collapse

Instance Method Details

#archive!Object



40
41
42
# File 'app/models/collavre/topic.rb', line 40

def archive!
  update!(archived_at: Time.current)
end

#archived?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'app/models/collavre/topic.rb', line 36

def archived?
  archived_at.present?
end

#set_primary_agent!(agent) ⇒ Object

Sets or replaces the primary agent for this topic



32
33
34
# File 'app/models/collavre/topic.rb', line 32

def set_primary_agent!(agent)
  update!(primary_agent: agent)
end

#unarchive!Object



44
45
46
# File 'app/models/collavre/topic.rb', line 44

def unarchive!
  update!(archived_at: nil)
end