title: has_one :through association error: Cannot have a has_one :through association where the :through association is a collection
body: <p>I have the models <code>Subscription</code>, <code>SubscriptionCart</code> and <code>Invoice</code>. A subscription <code>has_many</code> <code>:subscription_carts</code>, and a subscription_cart <code>has_many</code> <code>:invoices</code>.</p>
  <p>I need to associate a <code>Subscription</code> with an <code>Invoice</code> of <code>scheduled</code> status of which each <code>SubscriptionCart</code> has only one (that relation already exists).</p>
  <p>subscription:</p>
  <pre><code>class Subscription &lt; ApplicationRecord
    has_many    :subscription_carts
  end
  </code></pre>
  <p>subscription_cart:</p>
  <pre><code>class SubscriptionCart &lt; ApplicationRecord
    belongs_to :subscription
    has_many   :invoices, as: :invoiceable
    has_one    :scheduled_invoice, -&gt; { scheduled }, class_name: :Invoice,
                                                     inverse_of: :invoiceable,
                                                     as: :invoiceableh
  end
  </code></pre>
  <p>invoice:</p>
  <pre><code>class Invoice &lt; ApplicationRecord
    belongs_to :invoiceable, polymorphic: true
  end
  </code></pre>
  <p>I tried with the following statement in the Subscription model:</p>
  <pre><code>has_one     :scheduled_invoice, through: :subscription_carts, source: :scheduled_invoice
  </code></pre>
  <p>However, I'm getting the following error:</p>
  <blockquote>
  <p>ActiveRecord::HasOneThroughCantAssociateThroughCollection: Cannot have
  a has_one :through association 'Subscription#scheduled_invoice' where
  the :through association 'Subscription#subscription_carts' is a
  collection. Specify a has_one or belongs_to association in the
  :through option instead.</p>
  </blockquote>
  <p>I don't fully understand what the error is telling me nor the suggestion it's giving me.</p>
  <p>I've also tried <code>has_one     :scheduled_invoice, -&gt; { scheduled.ordered_by_due_date }, through: :subscription_carts, class_name: &quot;Invoice&quot;</code> with the same results.</p>