I want to get distinct records in rails. For that I see this Rails: how can I get unique values from column
But the issue is that by this solution I only get the Ids .
ViewsLog.uniq.pluck(:unit_id)
[24, 21, 23, 4, 16, 5, 7]
I want all columns of uniq unit_id