Class: Denshobato::Conversation
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Denshobato::Conversation
- Includes:
- HelperUtils
- Defined in:
- lib/denshobato/models/conversation.rb
Instance Method Summary collapse
Instance Method Details
#from_trash ⇒ Object
44 45 46 47 48 |
# File 'lib/denshobato/models/conversation.rb', line 44 def from_trash # Move conversation from trash to_trash { false } end |
#messages ⇒ Object
Methods
30 31 32 33 34 35 |
# File 'lib/denshobato/models/conversation.rb', line 30 def # Return all messages of conversation ids = notifications.pluck(:message_id) .where(id: ids) end |
#to_trash ⇒ Object
37 38 39 40 41 42 |
# File 'lib/denshobato/models/conversation.rb', line 37 def to_trash # Move conversation to trash bool = block_given? ? yield : true update(trashed: bool) end |