How can I filter first n records based on a specific column? For example, the column name
in Recommendation
?
if the name of record 1 and 2 were both Dave
, record 1 and 3 would be returned and not record 2.
Recommendation.where(id: [1,2,3,4]).limit(2)`
I tried to use distinct but it appears you need to also use pluck which I'd rather not do because I'd like the object.