Class: Hub::Topic

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
SoftDelete, Uid
Defined in:
app/models/hub/topic.rb

Instance Method Summary collapse

Methods included from SoftDelete

#deleted?, #destroy

Instance Method Details

#activity_atObject



34
35
36
# File 'app/models/hub/topic.rb', line 34

def activity_at
  replied_at || updated_at || created_at
end

#set_last_active_markObject



24
25
26
# File 'app/models/hub/topic.rb', line 24

def set_last_active_mark
  self.last_active_mark = Time.now.to_i
end

#set_show_in_recentObject



29
30
31
32
# File 'app/models/hub/topic.rb', line 29

def set_show_in_recent
  Topic.where(customer: customer).update_all(show_in_recent: false)
  update_column('show_in_recent', true)
end