I am trying to create a query with activerecord that includes a subselect. I am doing this in an attempt to get rid of an n+1 issue with the previously used `.merge()`. https://gist.github.com/jmetzmeier/9f9883e8e4b1c07329acd88d32e4563e
the link above shows the query I am trying to replicate, as well as my current attempt at solving. Another question is that if I am able to get the proper query to execute, will I still get a proper object for my model?