chore: rename adapterOptions.scope_id to adapterOptions.scopeID

This commit is contained in:
Randall Morey committed 2020-07-16 18:22:44 -04:00
1 parent 433ae8c022
commit 45b419e641
4 files changed
+16 -16

No files matched your search

+4 -4
View File
@@ -44,12 +44,12 @@ export default class BaseModel extends Model {
/**
* If this model instance has a related scope, the scope's ID will be passed
* via `adapterOptions.scope_id` automatically. End users may optionally
* via `adapterOptions.scopeID` automatically. End users may optionally
* pass a custom scope ID to override.
*
* @example
* model.save(); // passes the model's current scope ID
* model.save({adapterOptions: {scope_id: 'global'}}); // override scope ID
* model.save({adapterOptions: {scopeID: 'global'}}); // override scope ID
*
* End users may specify a _custom method_ via `adapterOptions.method`.
* Custom methods are appended to the record's URL by the adapter.
@@ -62,8 +62,8 @@ export default class BaseModel extends Model {
*/
save(options={adapterOptions: {}}) {
const scopeID = this.belongsTo('scope').id();
if (scopeID && !options.adapterOptions.scope_id) {
options.adapterOptions.scope_id = scopeID;
if (scopeID && !options.adapterOptions.scopeID) {
options.adapterOptions.scopeID = scopeID;
}
return super.save(options);
}