title: Confusion regarding belong_to, has_one, has_many
body: <p>I am trying to extend the function of a Shift model in my project.
  I have two types of shifts Ashift and Bshift, that are immediately related to Shift.</p>
  
  <p>My confusion stems from how to set up the associations in Shift. This is what I have:</p>
  
  <p>I am trying to say that Shift has one <strong>or the other</strong> dependent shift class, but not both, and also not neither.</p>
  
  <pre><code>class Ashift &lt; ApplicationRecord
    belongs_to :shift
  end
  class Bshift &lt; ApplicationRecord
    belongs_to :shift
  end
  
  class Shift &lt; ApplicationRecord
    has_one :ashift
    has_one :bshift
  end
  </code></pre>
  
  <p>I am sure this is clearly laid out in the <a href="https://edgeguides.rubyonrails.org/association_basics.html#the-has-one-through-association" rel="nofollow noreferrer">association guide</a> but I've read it a couple of times, and I am still subtlety confused.</p>
  
  <p>Does has_one, or has_many, refer to each instance of the model, or the Model class as a whole? Is there a different, or better way of doing this?</p>