title: Rails associations SQL
body: <p>I have a User model and a SkillList model.</p>
  
  <p>Association - <code>has_many / belongs_to</code>.</p>
  
  <p><em>So I can find the skill list entry for one user:</em></p>
  
  <pre><code>current_user.skill_list
  </code></pre>
  
  <p>The user table has fields: <code>id</code>, <code>name</code> and <code>location</code>.</p>
  
  <p>I need to query the database to find all users who have location and skills.</p>
  
  <p><em>I can find all users with an existing location (not including current user):</em></p>
  
  <pre><code>users = User.where.not(location: nil, id: current_user.id)
  </code></pre>
  
  <p><strong>But how to exclude users without skills?</strong></p>