Add promise support to built-in model RoleMapping#3169
Merged
bajtos merged 1 commit intostrongloop:masterfrom Feb 1, 2017
Merged
Add promise support to built-in model RoleMapping#3169bajtos merged 1 commit intostrongloop:masterfrom
bajtos merged 1 commit intostrongloop:masterfrom
Conversation
|
Can one of the admins verify this patch? |
3 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
ebarault
commented
Jan 31, 2017
| this.roleModel = reg.getModelByType('Role'); | ||
| this.userModel = reg.getModelByType('User'); | ||
| this.applicationModel = reg.getModelByType('Application'); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
this change is required as the use of loopback.Role would lead to inconsistent results given the recent introduction of app-local registry
336abd7 to
d53f05c
Compare
Contributor
Author
|
@superkhau, @bajtos i add more promise support as required by #2971 |
2 tasks
Member
|
@slnode ok to test |
bajtos
suggested changes
Feb 1, 2017
test/role-mapping.test.js
Outdated
|
|
||
| it('supports .user() with a callback', function(done) { | ||
| models.RoleMapping.create( | ||
| {principalType: 'USER', principalId: oneUser.id}, function(err, mapping) { |
Member
There was a problem hiding this comment.
one arg per line please - http://loopback.io/doc/en/contrib/style-guide.html#one-argument-per-line
test/role-mapping.test.js
Outdated
|
|
||
| it('supports .childRole() with a callback', function(done) { | ||
| models.RoleMapping.create( | ||
| {principalType: 'ROLE', principalId: aRole.id}, function(err, mapping) { |
Member
There was a problem hiding this comment.
d53f05c to
ceceb44
Compare
bajtos
approved these changes
Feb 1, 2017
Member
|
Landed, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
None of the methods from built-in model RoleMapping currently support promises. this PR adds promise support by using loopback utils helper
In addition no tests exist for RoleMapping model. this PR also add a new set of tests in a dedicated file to cover both callback and promise versions of those methods
Related issues
related issue: #418
Checklist
guide