Check is a model that has the attributes product_line_id and date.
I have four instances of the Check model. They all have different dates. Two belong to product line 1 and the other two belong to product line 2.
How do I call a query on the Check model to return one check for each product line having the greatest date for for that product line?
I agree with noodl: you shouldn’t be using
dateas the column’s name.