0

With regard to the Rails Mailboxer Gem, I want to know which box_type a particular conversation belongs to.

rewath
  • 41
  • 1
  • 8

1 Answers1

0

I think I might have an answer for you, but, as did I, you probably won't like it.

Mailboxer allows conversations to belong to more than one box, because sent conversations may also belong to the inbox.

Unfortunately, this is also true with trashed conversations. Unless you remove them from the receipts, every new message will make the conversation go to the inbox and it will still belong to the trashed conversations.

The only way I can imagine getting a true or false on whether or not a conversation belongs to a box is:

def belongs_to_inbox?(conversation)
  @success = @mailbox.inbox.find(params[:id])
end

I hope this answered your question and that you found this helpful!

fbelanger
  • 3,522
  • 1
  • 17
  • 32