refactor: rename parent_scope_id to scope_id

This commit is contained in:
Randall Morey committed 2020-07-22 13:32:06 -04:00
1 parent 81011b92e3
commit df3cd1e72c
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@ export default class ScopeSerializer extends ApplicationSerializer {
/**
* While most resources do not serialize scope into a request body (scope
* is expressed in the URL), scopes themselves _do serialize scope_ as a
* string field `parent_scope_id`.
* string field `scope_id`.
* Otherwise delegate to default attribute serializer.
*
* @override
@@ -27,7 +27,7 @@ export default class ScopeSerializer extends ApplicationSerializer {
const value = super.serializeAttribute(...arguments);
const parentScope = snapshot.attr('scope');
if (key === 'scope' && this._canSerialize(key) && parentScope) {
json.parent_scope_id = parentScope.attr('scope_id');
json.scope_id = parentScope.attr('scope_id');
delete json[key];
}
return value;