Closed wbw20 closed 10 years ago
I have some code that looks like:
Post.all({ include: ['user'] }, function(error, data) {( )};
but when I inspect my data, the posts have their users in a hidden field called __cachedRelations. Is there a clean way of getting a javascript object with the relation as a simple attribute? Thanks.
You can access relations as usual:
Post.all({ include: ['user'] }, function(error, data) {( data[0].user(function(err, user) { }); )};
I have some code that looks like:
but when I inspect my data, the posts have their users in a hidden field called __cachedRelations. Is there a clean way of getting a javascript object with the relation as a simple attribute? Thanks.