Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. Project.create({ /* */ }).then(function(project) {
  2. return User.create({ /* */ }).then(function(user) {
  3. return project.hasUser(user).then(function(result) {
  4. // result would be false
  5. return project.addUser(user).then(function() {
  6. return project.hasUser(user).then(function(result) {
  7. // result would be true
  8. })
  9. })
  10. })
  11. })
  12. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement