Closed shaoner closed 9 years ago
In this case, the relationship may not fit well, it should be possible to:
var Photo = ziti.define('photo', {
path: ziti.String,
width: ziti.Int,
height: ziti.Int,
user: ziti.ForeignKey('User')
});
var User = ziti.define('User', {
username: ziti.String,
photos: [ Photo ]
});
User.at({ id: 42, photos: { width: 32, height: 32 } })
// SELECT * FROM `user` `User`
// LEFT JOIN `photo` `photos` ON `photos`.`user_id` = `User`.`id`
// AND `photos`.`width` = 32 AND `photos`.`height` = 32
It should be possible to: