I have a bunch of arrays containing records retrieved from the
database in separate queries. That can’t be changed - I have deal with
the different arrays of these records. Each of these records contains,
amongst other data fields, two ids - a user_id and an address_id.
Now my task is to take all these records in different arrays and
extract out an array of unique records from them (unique combination
of user_id and address_id) as the same record may be present in
One way to do it is to brute force it by extracting, looping and
finding each user_id and address_id combination - but that is not
clean. Given the elegance Ruby affords, I believe there must a better
way to do this. Appreciate any thoughts on how to go about doing this.