Let's say I have an array of objects from the same class, with two attributes of concern here: name and created_at.
How do I find objects with the same name (considered dups) in the array, and then delete the duplicate record in the database. The object with the most-recent created_at date, however, is the one that must be deleted.