-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
handleFindAll() and buildList() can make diverse models #161
Conversation
This is a really interesting idea .. me like! handleFindAll('user', 2, 'trait1', {name: 'blah'}) how to do you differentiate between that and TestHelper.handleFindAll('user', {name: 'Alice'}, {name: 'Bob'}, ['admin', {name: 'Charlotte'}]); do you just say .. hey .. not number .. look for all args as separate to each new user? |
That's right: if the second argument is not a number, then it's assumed that the second and subsequent arguments are the specification for each model. Each of these arguments can be an array |
This clearly is a fun feature. So thanks for the great idea. Can you add a few more tests ( you have one I think ) .. need one or two for handleFindAll and then change the README to show the new feature .. |
Also making the test more rigorous (previously, it could have passed even if the created_at attribute was not being set correctly)
@danielspaniel How does that look? |
handleFindAll() and buildList() can make diverse models
Pretty good mate .. thanks! :) |
Thanks for merging this so quickly! Are you planning a new release soon? |
Yes, I will do this today ( I was wondering when you would ask .. so thanks for the nudge ). Was waiting to do other upgrades, but I am taking too long. |
The
handleFindAll
function is a bit lacking in that all of the models it generates are identical (except for sequences). This PR allows it to be called with a list of traits/options instead of a number.