Class: Denshobato::Message

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/denshobato/models/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conversation_idObject

Returns the value of attribute conversation_id.



3
4
5
# File 'lib/denshobato/models/message.rb', line 3

def conversation_id
  @conversation_id
end

Instance Method Details

#message_timeObject



30
31
32
33
34
# File 'lib/denshobato/models/message.rb', line 30

def message_time
  # Formatted time for chat panel

  created_at.strftime('%a %b %d | %I:%M %p')
end

#send_notification(id) ⇒ Object

Methods



22
23
24
25
26
27
28
# File 'lib/denshobato/models/message.rb', line 22

def send_notification(id)
  # Find current conversation
  conversation = hato_conversation.find(id)

  # Create Notifications
  create_notifications_for(conversation)
end