0

I am creating User messaging functionality from scratch, and am attempting to figure out how to structure my app so that each user's inbox is ordered with unread messages appearing first, followed by already read messages.

I have a message model with sender_id, recipient_id, and conversation_id.

Any ideas / suggestions?

neon
  • 2,811
  • 6
  • 30
  • 44

1 Answers1

2

I may be oversimplifying here... but couldn't you add a boolean read column to your Message model? Then just :order_by => "read DESC"

jaredonline
  • 2,912
  • 2
  • 17
  • 24