You can just use the method uniq. Assuming your array is ary, call:
ary.uniq{|x| x.user_id}
and this will return a set with unique user_ids.
You can just use the method uniq. Assuming your array is ary, call:
ary.uniq{|x| x.user_id}
and this will return a set with unique user_ids.