Class: Collavre::Topic

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

Instance Method Summary collapse

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

Returns:

  • (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