When using the Basic Adapter, what is the best way to handle the embedded relationships?
Nucleus.User.sync = { find: function (id, load) { var url = 'users/' + id; Nucleus.URL.basicLoad(url).then(function (user) { return normalizeUser(user); }).then(function(user) { user.authorities.forEach(function (authority) { Nucleus.Authority.create({ name: authority.name, access: authority.access, user: user.id }); }); load(normalizeUser(user)); }); } }
Something like this? I was reviewing the guides and Tom’s latest example on github, but was confused on the proper way to handle situations like this.