Complex resource generation?
Hey guys, I'm getting a bit of chicken & egg problem when I try to create my resources using generators. As most of them are somehow related to one another, I get all sorts of compile time errors, no matter which ones I try to run first. How do you handle these situations yourselves? Is it at all possible to build my app using generators, or do I have to manually write most of them?
For example, a
Subtitle
belongs to a Video
, and a Video
has many Subtitle
s. Whenever I try to crate one, the othe must be already present, otherwise I get an error. Maybe I'm doing something wrong?
3 Replies
If I try to do it the other way around (subtitle first), I get this:
Is there maybe a way of generating everything first, and then compiling all together?
Ohhh, I see your issue
You can generate w/o the relationships first
I thought you meant test data generation
In the latest version, the generators will patch
so you can add relationships in by running again w/ just the relationships
Then I run again the same
ash.gen.resource
tool to add the relationships?
oh, ok
thanks, I will try that