ActiveRelation that requires nested joins using scopes
问题 I am new to rails. Having a blast. The query API though is giving me some trouble. I've been zooming and doing a lot of stuff very quickly, but this is the first time I have spent hours trying to figure it out. It's not like anything I've used before - regular SQL, or Hibernate, or whatever. The model I have is pretty simple. A PrivateMessage has many Recipients A Recipient has a Receiver (which of class User) recipient also has fields for 'is_read' and 'is_deleted' My goal is to build a