Try pass the block:
(array1 + array2 + arrayN].uniq { |instance| [instance.user_id,
instance.address_id]}
undocumented feature
On 03.06.2011, at 22:23, skt wrote:
> Thanks Michael and Tim.
>
> On Jun 3, 11:19 am, Tim Shaffer <[email protected]> wrote:
>> I think the problem with doing that is that the arrays contain instances of
>> models.
>>
>> Sounds like skt wants to consider an instance unique based on only two
>> attributes of each instance.
>
> That's correct Tim - I am looking to uniq them only on the two id
> fields
--
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.