rapidjs / rapidjs.io

The docs for rapid.js

Home Page:http://rapidjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

write registerRelationships function

drewjbartlett opened this issue · comments

write a method to registerRelationships. So if given this:

users () {
   return this.hasMany(UserModel, 123);
}

// should now call 

this.users().get();

this.relationships.users.find(1);

THoughts:

registerRelationship(name, relation) {

   this.relationships[name] = relation;

}