title: Rails - has_many :through find records which have no association
body: <p>I have three models</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
    has_many :assignments
    has_many :projects, through: :assignments
  end
  
  class Project &lt; ActiveRecord::Base
    has_many :assignments
    has_many :people, through: :assignments
  end
  
  class Assignment &lt; ActiveRecord::Base
    belongs_to :person
    belongs_to :project
  end
  </code></pre>
  
  <p>I'm using a attribute called 'kind' on the Assignment model to determine how the person is associated with the property.  It's a string field and possible values include: 'supervisor', 'worker', 'inspector'.</p>
  
  <p>I've added the attribute to the Assignment model rather than the Person model because in some scenarios its possible for a person to be a worker on one project, and a supervisor on another at the same time.</p>
  
  <p>Its important to note, that when created a supervisor is automatically assigned.  Therefore all projects will have at least one assignment already.</p>
  
  <p>What I'm wondering is this:</p>
  
  <p>How do I query all projects which have no workers assigned?  This would be a project which has no assignments which have 'worker' in the kind column.</p>