title: Ruby on Rails ActiveRecord query using a join
body: <p>I have a User model and the user has a relationship which is has_many pets. I want to be able to write an ActiveRecord query where I can select all users with a pet that doesn't have a pet.name of "fluffy"</p>
  
  <p>What's the most efficient way to write this using ActiveRecord? Using straight SQL it would look something such as the following:</p>
  
  <p><code>select id from users INNER JOIN pets ON u.id = pets.user_id WHERE pets.name != "fluffy"</code></p>