title: has_many and belongs (+ polymorphic)
body: <p>I have a Company, which is on top of the hierarchy. All questions asked by a user, belongs to the company. Currently a question has many to many relationship with groups and users. Which means that a question can be assigned to a group(s) or user(s). </p>
  
  <pre><code>class Question &lt; ActiveRecord::Base
    belongs_to :company
    has_many :answers
    has_many :question_participants
    has_many :users, through: :question_participants,
                     source: :questionable, source_type: 'User'
    has_many :groups, through: :question_participants,
                      source: :questionable, source_type: 'Group'
  </code></pre>
  
  <p>the association is done through a polymorphic, which is question_participants. Now what I wish to accomplish is to allow a question to belong to a company (which it currently does) but also be assigned to that company.</p>
  
  <p>I've tried just adding it like this:</p>
  
  <pre><code>  has_many :companies, through: :question_participants,
                      source: :questionable, source_type: 'Company'
  </code></pre>
  
  <p>and on the company model do:</p>
  
  <pre><code>  has_many :questions
    has_many :question_participants, as: :questionable
    has_many :questions, through: :question_participants
  </code></pre>
  
  <p>now the issue is that a question will that has many and belong to, which I think is the right approach but I'm not sure how to set this all up correctly.</p>