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

afterCreate and buildMany #25

Closed
siboulet opened this issue Nov 12, 2015 · 3 comments
Closed

afterCreate and buildMany #25

siboulet opened this issue Nov 12, 2015 · 3 comments

Comments

@siboulet
Copy link

Hi,

I discovered the afterCreate opiton while looking at the source code. It be great if the afterCreate option was documented in the README. This option is essential when using ex. passport-local-mongoose to set user password by calling setPassword() method before returning the created model.

Also, I noticed afterCreate is only called when using factory.create(), but not when using factory.createMany(). Is this expected behavior?

Thanks

@simonexmachina
Copy link
Owner

Good point. I've added docs and support for afterCreate to createMany()

@siboulet
Copy link
Author

@aexmachina thanks! Can you do a release with createMany() calling afterCreate callback?

@simonexmachina
Copy link
Owner

Yes I already published v2.2.0 (but the git push failed).

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

2 participants