I think I need something akin to a rails eager loaded query with a limit on it but I am having trouble finding a solution for that.
For the sake of simplicity, let
Regardless of what "that article" said, the issue is in SQL you can't narrow down the second sql query (of eager loading) the way you want in this scenario, purely by using a standard LIMIT
You can, however, add a new column and perform a WHERE clause instead
Person has_many :sample_of_comments, conditions: { is_sample: true }
is_sample
column to comments
tableComment#before_create
hook that assigns is_sample = person.sample_of_comments.count < 5