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

[5.6] Added states to model factory after callbacks #23551

Merged

Conversation

unstoppablecarl
Copy link
Contributor

This is an addition to this recently merged PR made by @Indemnity83.
#23495

It adds the ability to bind the after callbacks to specific model factory states using the existing api pattern of existing create/make methods.

I this is not completely ready for PR. I wanted to submit it quickly after the above PR was merged to keep the discussion going. It still needs tests. Tagging the people that discussed the above PR to get their input: @deleugpn @browner12 @shadoWalker89

@taylorotwell
Copy link
Member

Seems OK to me. Can you add tests?

@tillkruss tillkruss changed the title added states to model factory after callbacks [5.6] added states to model factory after callbacks Mar 15, 2018
@unstoppablecarl
Copy link
Contributor Author

Yes I can. I am traveling currently and will be back in a few days. I will finish it up then. I just wanted to get it out there quick while it was being discussed.

@GrahamCampbell GrahamCampbell changed the title [5.6] added states to model factory after callbacks [5.6] Added states to model factory after callbacks Mar 17, 2018
@browner12
Copy link
Contributor

I'm assuming the most recent push was a mistake, correct? lots of unrelated changes

@unstoppablecarl
Copy link
Contributor Author

ugh yes. I was merging from upstream why did it do that? and how do I fix it?

Now that #23495 has been merged, my proposed changes will have been breaking. I assume that is not OK and have updated the code accordingly although I am disappointed that the api is less consistent because of it.

@shadoWalker89
Copy link
Contributor

@unstoppablecarl I would make a hard reset on the feature branch, and then push to github using the --force flag

@unstoppablecarl
Copy link
Contributor Author

unstoppablecarl commented Mar 19, 2018

There are some existing areas in Factory that do not have test coverage. Should I add tests for them?

@browner12
Copy link
Contributor

keep this PR simple. if the tests are not related to this PR, save those change for another PR

@tillkruss
Copy link
Collaborator

A docs PR for this would be great.

@tillkruss
Copy link
Collaborator

What's the best way to get a Faker instance in callbacks?

@unstoppablecarl
Copy link
Contributor Author

It gives the faker instance in the second argument of the callback.

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

Successfully merging this pull request may close these issues.

None yet

5 participants