title: Rails - Find all by course id where user = unique
body: <p>I have the following table:</p>
  
  <pre><code>Tweet(id: integer, from_user: string, tweet_text: string, tweet_id: integer, course_id: integer, tweet_already_exists: boolean, tweet_posted_to_reviews: boolean, created_at: datetime, updated_at: datetime) 
  </code></pre>
  
  <p>And, for a specific course, I'd like to get the last 50 tweets, unique by user. I've gotten this far:</p>
  
  <pre><code> Tweet.order("tweet_id desc").find_all_by_course_id(@course.id).first(50)
  </code></pre>
  
  <p>The problem with this is that if a user has tweeted more than once, they appear twice (both tweets appear) and I'd only like to get that person's latest tweet.</p>
  
  <p>Thank you!</p>