Skip Menu |

This queue is for tickets about the DBIx-Class-Fixtures CPAN distribution.

Report information
The Basics
Id: 78667
Status: new
Priority: 0/
Queue: DBIx-Class-Fixtures

Owner: Nobody in particular
Requestors: frankschwach [...]

Bug Information
Severity: (no value)
Broken in: 1.001015
Fixed in: (no value)

Subject: can't configure to fetch through a belongs_to relationship
Download (untitled) / with headers
text/plain 1.1k
Assume the following relationships: A == belongs_to ==> B == has_many ==> C (and relationship names = lc class name) This does not work as I expected. I a fixtures config file: "sets":[ { "class":"A", "quantity":"5", "fetch":[ { "rel":"b", "quantity":"all", "fetch":[ { "rel":"c", "quantity":"all" } ] } ] } ] The C rows are not fetched. I think this is because belongs_to associations are fetched automatically anyway and the additional config on the "b" relationship ("fetch" in this case) seems to be ignored. The only way I could get this to work was by a rule on Result class B like this: "sets":[ { "class":"A", "quantity":"5" } ], "rules":{ "B":{ "fetch":[ { "rel":"c", "quantity":"all" } ] } } Ideally, the first version (recursive definition of relationships to fetch) should work but if not, then it would be great if the special behaviour of belongs_to associations could be explained a bit more in the docs and the work-around via a rule explained. Thanks for your help!

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to