goadesign / gorma

Storage generation plugin for Goa
http://goa.design
MIT License
140 stars 35 forks source link

The use of BelongsTo #161

Open eullerpereira94 opened 6 years ago

eullerpereira94 commented 6 years ago

In the last week I was messing around with gorma and I've noticed something: a model can't belong to two different models. I'm not talking about the philosophy behind the relational model. What I'm talking is about this:

` Model("ThisModel", func() {

    Alias("schema.thismodel")

    RendersTo(ThisModelMedia)

    BuildsFrom(func() {
        Payload("thismodel", "create")
        Payload("thismodel", "update")
    })

    BelongsTo("ThatOtherModel")

    BelongsTo("AThirdModel")
})

`

This makes the goagen tool unable to generate the appropriate code, in fact, any code, since it exits with a code 1.