title: Ruby remove duplicate objects from array
body: <p>I am not able to achieve the desired results with the conventional Ruby methods to remove all duplicate objects from the array, user_list, below. Is there a smart way to solve this problem?</p>
  
  <pre><code>users = []
  user_list.each do |u|
      user = User.find_by_id(u.user_id)
      users &lt;&lt; user
      #users &lt;&lt; user unless users.include?(user)  # does not work
  end
  #users = users.uniq  # does not work
  </code></pre>