不要怂,就是干,撸起袖子干!

Commit 6fd677ed by Jan Aagaard Meier

feat(scopes) Add support and test for several scopes specifying the same include…

… model. Add $ to a couple of comparators in docs
1 parent 24efbfda
...@@ -511,16 +511,15 @@ module.exports = (function() { ...@@ -511,16 +511,15 @@ module.exports = (function() {
* complexFunction: function(email, accessLevel) { * complexFunction: function(email, accessLevel) {
* return { * return {
* where: { * where: {
email: { * email: {
$like: email * $like: email
}, * },
accesss_level { * accesss_level {
$gte: accessLevel * $gte: accessLevel
} * }
} * }
}
* } * }
* }, * }
* } * }
* }) * })
* ``` * ```
......
...@@ -88,7 +88,7 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -88,7 +88,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
this.Company.create({ id: 2, active: false}), this.Company.create({ id: 2, active: false}),
this.ScopeMe.create({ id: 5, username: 'bob', email: 'bob@foobar.com', access_level: 1, other_value: 9, parent_id: 5}), this.ScopeMe.create({ id: 5, username: 'bob', email: 'bob@foobar.com', access_level: 1, other_value: 9, parent_id: 5}),
]); ]);
}).spread(function (u1, u2, u3, u4, c1, c2, u5, proj1, prof1) { }).spread(function (u1, u2, u3, u4, c1, c2, u5) {
return Promise.all([ return Promise.all([
c1.setUsers([u1, u2, u3, u4]), c1.setUsers([u1, u2, u3, u4]),
c2.setUsers([u5]), c2.setUsers([u5]),
......
...@@ -77,7 +77,7 @@ describe(Support.getTestDialectTeaser('Model'), function() { ...@@ -77,7 +77,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
expect(Company.scope('somethingTrue', 'somethingFalse').$scope).to.deep.equal({ expect(Company.scope('somethingTrue', 'somethingFalse').$scope).to.deep.equal({
where: { where: {
something: false, something: false,
somethingElse: 'cat' somethingElse: 42
}, },
limit: 5 limit: 5
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!