Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added failing tests for external, fix for tests #12

Merged
merged 2 commits into from
Sep 20, 2017

Conversation

cngarrison
Copy link
Contributor

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.

If config follows 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.

Signed-off-by: Charlie Garrison <cngarrison@gmail.com>
getting DateTime formatter from schema storage.

Error can occur earlier in code, unrelated to datetime formatter, and cause formatter to not be set. Don’t bail due to ancient errors.

Signed-off-by: Charlie Garrison <cngarrison@gmail.com>
@cngarrison
Copy link
Contributor Author

Commit 8789030 wasn't supposed to be part of this PR; apologies for my lack of GitHub knowledge. I'm not sure how to separate it now.

@samuelkaufman
Copy link

just saw this, I'll take a look this weekend. Thanks @cngarrison

@dbsrgits-sync dbsrgits-sync merged commit 8789030 into dbsrgits:master Sep 20, 2017
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Sep 27, 2017
1.001039  2017-09-25 14:15:55+00:00 UTC

- remove trailing comma in tests that was breaking on most JSON parsers.

1.001038  2017-09-20 21:13:13+00:00 UTC

- stop sorting source names before dumping, this allows for some hackery when you need certain sources to dump first (see dbsrgits/DBIx-Class-Fixtures#12 for details) (cngarrison++)
- doc patch for exclude attr (simbabque++)

1.001037  2017-09-20 20:42:03+00:00 UTC

- ignore virtual columns in dump_object (mmims++)
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Oct 22, 2017
1.001039  2017-09-25 14:15:55+00:00 UTC

- remove trailing comma in tests that was breaking on most JSON parsers.

1.001038  2017-09-20 21:13:13+00:00 UTC

- stop sorting source names before dumping, this allows for some hackery when you need certain sources to dump first (see dbsrgits/DBIx-Class-Fixtures#12 for details) (cngarrison++)
- doc patch for exclude attr (simbabque++)

1.001037  2017-09-20 20:42:03+00:00 UTC

- ignore virtual columns in dump_object (mmims++)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants