OneThrought Relationship

Hi.

I’ve created the following models:

Industry.js

activities(){
    return this.hasMany('App/Models/Activity')
}

Activity.js

industry(){
    return this.belongsTo('App/Models/Industry')
 }

offers(){
  return this.hasMany('App/Models/Offer')
}

Offer.js

activity(){
    return this.belongsTo('App/Models/Activity')
}
industry(){
   return ???????
}

I want to create a industry() relationship on Offer.js . Any suggestion on how to achieve this?

Can you share your DB migrations / schema?
Would be easier when can see what’s going on in DB

1 Like