1602/jugglingdb — Issue #22: recursive belongsTo
Author: pctj101
Created: 2012-01-23 06:01:37+00:00
State: open

Not sure if this should work... but if I want a parent-child relation on the same collection, it seems to generate non-functional convenience methods.

Example:

var Topics = describe('Topic', function () {
property('name', String);
});
Topics.hasMany(Topic, {as: 'subtopic', foreignKey:'topicId'});
Topics.belongsTo(Topic, {as: 'parentTopic', foreignKey:'topicId'});

if eventually I try to do

subtopic.parentTopic() I get nothing in return.

if I try:

topic.subtopics(callback) I get every topic in existence.