chore: rename adapterOptions.scope_id to adapterOptions.scopeID
This commit is contained in:
4 files changed
+16
-16
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user