title: Rails - Polymorphic association join table
body: <p>I am currently trying to set up a model structure that seems quite simple, but I haven't quite got it down.</p>
  
  <p>I have a model <code>payment</code> that can belong to either a <code>customer</code> or a <code>supplier</code> (which can both have many <code>payments</code>).</p>
  
  <p>My question is simply whether I need to manually create an interface table to allow this, or if declaring the polymorphic associations will do this for me?</p>
  
  <p>e.g. I have:</p>
  
  <pre><code>class Payment &lt; ActiveRecord::Base
      belongs_to :payment_originator, :polymorphic =&gt; true
  end
  
  class Customer &lt; ActiveRecord::Base
      has_many :payments, :as =&gt; :payment_originator
  end
  
  class Supplier &lt; ActiveRecord::Base
      has_many :payments, :as =&gt; :payment_originator
  end
  </code></pre>
  
  <p>Is this enough, or do I also need to use a generator to manually create the payment_originator model?</p>
  
  <p>Thanks!</p>