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

Add a few notes about model objects #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michaelgwelch
Copy link

I struggled to figure out how to use factory-girl, because the tutorial and README make no mention of how the factory interacts with the model. What I learned is that it calls the constructor of your model and passes in a single object that is used to instantiate the model object.

Perhaps this is obvious to others but as someone that doesn't do a tremendous amount of JavaScript development I was confused as to why the factory created an instance of my model and that this was being nested inside of just one of my properties of the model. (My model classes had constructors with arguments for each property.)

This is a proposal to make an addition to the README and tutorial that just shows what a model class might look like.

In particular, explain that the factory methods will call the constructor
with one object that has all the properties needed to instantiate the
object.
@michaelgwelch michaelgwelch force-pushed the add-comments-about-model-requirements branch from f5a469d to 4572f8d Compare July 9, 2021 00:10
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.

1 participant