模型关联:
Entity_Department.hasOne('entity', db.models.entity, {reverse: 'entity_departments'});
Entity_Department.hasOne('entity_location', db.models.entity_locations, {reverse:'admin'});
服务器端控制器:
Entity_Location.get(entity_locations_id, function(err, entity_locations){
entity_locations.getAdmin(function(err, departments){
for(var i = 0; i < departments.length; i++ ){
departments[i].ede_is_deleted = true;
departments[i].ede_updated_at = new Date();
}
它表明getAdmin()
不是函数。同样的概念适用于其他模型,所以我哪里出错?