[DBIx-Class-Devel] [dbsrgits/DBIx-Class-Fixtures] Added failing tests for `external`, fix for tests (#12)

Charlie Garrison notifications at github.com
Wed Oct 19 02:51:52 GMT 2016


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

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 `dump`, then the 'Album' set is dumped before the 'Photo' set, and the `external` attribute is not included. 

Putting 'Photo' first in the `sets` 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. 

The revised test files in this commit fail without the change to Fixtures.pm. 

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. 
You can view, comment on, or merge this pull request online at:

  https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12

-- Commit Summary --

  * Added failing tests for `external`, fix for tests

-- File Changes --

    M lib/DBIx/Class/Fixtures.pm (2)
    M t/18-extra.t (5)
    M t/lib/ExtraTest/Schema.pm (73)
    M t/var/configs/extra.json (12)

-- Patch Links --

https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12.patch
https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/12
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20161018/41652958/attachment.htm>


More information about the DBIx-Class-Devel mailing list