node-orm2 icon indicating copy to clipboard operation
node-orm2 copied to clipboard

No getter/setter functions - reverse relationship on hasOne

Open PrasannaVenkadesh opened this issue 9 years ago • 1 comments

I have two models.

  1. Category
  2. Resource

I have defined the hasOne relationship on Resource model like this.

Resource.hasOne('category', db.models.category, { 'reverse': 'resources' });

After db sync, resource.getCategory(function) is available but, category.getResources(function) has not been made available.

node_orm_issue

P.S: Using node-orm2 version 3.1.0 and nodejs v6.2.0

PrasannaVenkadesh avatar Nov 12 '16 14:11 PrasannaVenkadesh

Same here ...

ModelOne.hasOne('model_two', ModelTwo, { reverse: 'model_one', autoFetch: true });

Unable to find model_two.getModel_one()

diaakasem avatar Nov 22 '16 08:11 diaakasem