Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow res to be passed as orm callback for standard usage #282

Closed
mikermcneil opened this Issue · 1 comment

2 participants

@mikermcneil
Owner

In your controllers, instead of:

User.findAll().done(function (err, users) {
  if (err) res.send(err,500);
  else if (res.viewExists) res.view({ models: users });
  else res.json(users);
});

You'd be able to do:

User.findAll().done(res);

Which can actually be optimized internally to:

User.stream().pipe(res);
@CWyrtzen
Collaborator

Noted~

@CWyrtzen CWyrtzen closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.