İndex.js ve birkaç model (sınıf) index.js içeren bir klasörüm var
module.exports = {
Book : require('./book'),
Author : require('./author')
}
book.js
var Author = require('./author')
var Book = models.ActiveRecord.extend({
schema : {
belongsTo : {
author : Author
}
}
})
module.exports = Book
author.js
var Book = require('./book')
var Author = models.ActiveRecord.extend({
schema : {
hasMany : {
author : Book
}
}
})
module.exports = Author
Sorun şu ki Yazar sınıfı Kitabı bulamıyor! Bu sadece boş bir Nesne. Ancak, index.js'de dışa aktarımı değiştirirsem, Kitabı Yazardan sonra koyarsam - çalışır, ancak diğer model çalışmayı durdurur.
Çalışması için herhangi bir hack yapmak istemiyorum.