Advertisement
Guest User

Untitled

a guest
May 29th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. Account.forge({
  2. id: 1
  3. }).fetch({
  4. withRelated: ['accounts']
  5. }).then(function (account) {
  6. return account.related('accounts');
  7. }).then(function (accounts) {
  8. var account = accounts.at(0).toJSON({ omitPivot: true });
  9. res.json(account);
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement