Add a few notes about model objects #155
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.