How do I change the following bit of code so that I only have records with distinct sender_id
and message_id
combinations:
@roles = Role.find_all_by_simulation_id(session[:sim_id])
@messages = RolesMessages.find(:all, :conditions => ["sender_id IN (?) ", @roles.map(&:id)], :order => 'created_at DESC')