I have a hash like so:
[
{
:lname => "Brown",
:email => "[email protected]",
:fname => "James"
},
{
:lname => nil,
:email => "[email protected]",
:fname => nil
},
{
:lname => "Smith",
:email => "[email protected]",
:fname => "Brad"
},
{
:lname => nil,
:email => "[email protected]",
:fname => nil
},
{
:lname => "Smith",
:email => "[email protected]",
:fname => "Brad"
},
{
:lname => nil,
:email => "[email protected]",
:fname => nil
}
]
What I would like to learn how to do is how to remove a record if it is duplicate. Meaning, see how there are several "[email protected]" how can I remove the duplicate records, meaning remove all the others that have an email of "[email protected]".... Making email the key not the other fields?