On Fri, Jun 3, 2011 at 9:49 AM, skt <[email protected]> wrote:

> Hello,
>
> 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.
>
>
Does each array hold the same or different type of object?

-Conrad


> 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
> multiple arrays.
>
> 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.
>
> Thanks,
> -S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to