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

Array within object causes 'force' properties to be ignored #7

Open
josh-g3 opened this issue Sep 26, 2018 · 0 comments
Open

Array within object causes 'force' properties to be ignored #7

josh-g3 opened this issue Sep 26, 2018 · 0 comments

Comments

@josh-g3
Copy link

josh-g3 commented Sep 26, 2018

Ok so I've figured out that you need to use dot notation to force nested props, and I've written a random-length loop in my lib to populate arrays, but it's still not picking up arrays WITHIN objects no matter which syntax I try it with. Minimal fail case follows:

const options = {
  ...
  'relationships.parent': '<parent_id>', // this one works
  'relationships.children': [
    '<child_id>',
    '<child_id>',
  ],
  // OR
  'relationships.children.0': '<child_id>',
  'relationships.children.1': '<child_id>',
  // OR
  'relationships.children[0]': '<child_id>',
  'relationships.children[1]': '<child_id>',
}

In both cases above (as well as passing in the fully-structured relationships object), running dummy(Model, options) causes the children to get populated with random strings, not the specific ID strings I'm trying to set them to. All the other fields I'm trying to use this on, including inside top-level arrays, are populated correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant