title: Polymorphic habtm relationships with Rails/ActiveRecord
body: <p>How would I go about creating a polymorphic has_and_belongs_to_many relationship with Rails/ActiveRecord?</p>
  
  <p>Most of the examples I see involve creating a belongs_to relationship which limits my polymorphic-side to being related to only one parent:</p>
  
  <p>Table: Task</p>
  
  <p>Table: Tasks_Targets</p>
  
  <p>Table: CustomerStore</p>
  
  <p>Table: SoftwareSystem</p>
  
  <p>Both CustomerStore and SoftwareSystem would be of type "Targetable" in this circumstance.  From what I understand, if I implement the polymorphic relationship as most examples show, I'd only be able to relate a Targetable to a Task <strong>once</strong>.</p>
  
  <p>Some clarification might help as most searches online still leave some of the theory behind this relationship unexplained...</p>
  
  <p>Thanks!</p>