fix: 🐛 role discard should not error (#1226)
This commit is contained in:
1 parent
bfc433dc38
commit
ec56d2fbbe
4 files changed
+7
-5
No files matched your search
@@ -27,7 +27,9 @@ export default class RoleModel extends GeneratedRoleModel {
|
||||
* Convenience for looking up the grant scope, if loaded.
|
||||
*/
|
||||
get grantScope() {
|
||||
return this.store.peekRecord('scope', this.grant_scope_id);
|
||||
return this.grant_scope_id
|
||||
? this.store.peekRecord('scope', this.grant_scope_id)
|
||||
: null;
|
||||
}
|
||||
|
||||
// =methods
|
||||
|
||||
@@ -23,7 +23,7 @@ export default factory.extend({
|
||||
case 'static':
|
||||
default:
|
||||
return {
|
||||
'credentials': ['create', 'list'],
|
||||
credentials: ['create', 'list'],
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
@@ -18,4 +18,4 @@ export default factory.extend({
|
||||
username: random.word(),
|
||||
};
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,11 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Model | credential', function(hooks) {
|
||||
module('Unit | Model | credential', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('credential', {});
|
||||
assert.ok(model);
|
||||
|
||||
Reference in new issue
Block a user