What is the intended behavior of the include option when using model.build?
See original GitHub issueThe documentation does not clearly explain what is supposed to happen when you perform:
myModel = await MyModel.build(data, { include: [MyOtherModel] });
My expectation was that the myOtherModel
property would be populated at the time of calling build()
(since the myOtherModelId
foreign key is definitely in the database), but from looking at the object in the debugger, this does not appear to be the case.
My desire is to be able to build an object then be able to get the value of myModel.myOtherModel.id
, but since myOtherModel
is undefined, this doesn’t work.
Is there any way to get myOtherModel
to populate without having to save the model? (I do not want to save the model unless a particular condition is met.)
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Behavioral Change Models - SPH
The TPB states that behavioral achievement depends on both motivation (intention) and ability (behavioral control). It distinguishes between three types of ...
Read more >PBS Practice Competing Behavior Model
The competing behavior model helps to provide a link between functional assessment informa- tion and developing a positive behavioral support plan.
Read more >Behavior Management Models
This chapter describes what is meant by disci- pline and various models used in schools to deal with student behavior. An analysis of...
Read more >The behaviour change wheel: A new method for ...
It includes habitual processes, emotional responding, as well as analytical decision-making.
Read more >Encouraging Appropriate Behavior - IRIS Center
Choice Making . ... InTASC Model Core Teaching Standards are designed to help teachers of all ... behavior through the use of evidence-based...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As far as I know this is still an issue.
Bump
Yea… I didn’t know that either 😛