When declaring relationships of models, it should be possible to declare strings instead of the object itself. This is useful for when declaring self-relationships.
Example:
var Pipeline = models.declare("Pipeline", function(it, kind) {
it.has.field("name", kind.string);
it.has.many("instructions", "BuildInstruction", "pipeline");
it.validates.uniquenessOf("name");
it.has.getter('permalink', function(){
return '/pipeline/' + this.__id__;
});
});
When declaring relationships of models, it should be possible to declare strings instead of the object itself. This is useful for when declaring self-relationships.
Example: