<p>If config uses has_many to dump a set, the set’s config is not used, so attrs such as <code>external</code> are not honoured. Even using <code>rules</code> does not solve the problem. Using unsorted <code>sets</code> array to specify dump order solves the problem.</p>

<p>Using extra.json from this commit as an example. The 'Album' set is configured to fetch all has_many photos. When sets are sorted as part of <code>dump</code>, then the 'Album' set is dumped before the 'Photo' set, and the <code>external</code> attribute is not included. </p>

<p>Putting 'Photo' first in the <code>sets</code> array should fix that dependancy, but doesn't if sets are sorted by class name. This patch removes the sorting of sets, and dumps them in the order defined in the config. </p>

<p>The revised test files in this commit fail without the change to Fixtures.pm. </p>

<p>Whether the fix of 'not sorting' is correct solution is debatable. I believe that array order in config should be honoured, and not sorted by class name. </p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12'>https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Added failing tests for `external`, fix for tests</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12/files#diff-0">lib/DBIx/Class/Fixtures.pm</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12/files#diff-1">t/18-extra.t</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12/files#diff-2">t/lib/ExtraTest/Schema.pm</a>
    (73)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12/files#diff-3">t/var/configs/extra.json</a>
    (12)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12.patch'>https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12.patch</a></li>
  <li><a href='https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12.diff'>https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AASeAvgdgl-mA0YgutzU9r5ti8ia6hDtks5q1YXIgaJpZM4Kagbv">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AASeAmx1TfwOjZDk-uUuQKgOYdUCUKDWks5q1YXIgaJpZM4Kagbv.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/dbsrgits/DBIx-Class-Fixtures","title":"dbsrgits/DBIx-Class-Fixtures","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/dbsrgits/DBIx-Class-Fixtures"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Added failing tests for `external`, fix for tests (#12)"}],"action":{"name":"View Pull Request","url":"https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12"}}}</script>