strongloop/loopback-datasource-juggler — pull request #82 by raymondfeng (2014-03-04 16:31:29+00:00)
Title: Allows scopes to be defined in LDL

/to @ritch

The PR adds an extension to LDL so that scopes can be defined in the options for a model, for example:

var User = ds.createModel('User', {name: String, vip: Boolean, age: Number},
{scopes: {vips: {where: {vip: true}}, top5: {limit: 5, order: 'age'}}});

It adds two methods to User model:

User.vips(cb);
User.top5(cb);