Refactor serializer and model with suggestions from previous PR for managed-group.
22 lines
660 B
JavaScript
22 lines
660 B
JavaScript
import GeneratedManagedGroupModel from '../generated/models/managed-group';
|
|
import { attr } from '@ember-data/model';
|
|
import { fragment } from 'ember-data-model-fragments/attributes';
|
|
import { A } from '@ember/array';
|
|
|
|
export default class ManagedGroupModel extends GeneratedManagedGroupModel {
|
|
// =attributes
|
|
/**
|
|
* Members is read-only under normal circumstances. But members can
|
|
* be persisted via calls to `addMembers()` or `removeMembers()`.
|
|
*/
|
|
@attr({
|
|
readOnly: true,
|
|
defaultValue: () => A(),
|
|
emptyArrayIfMissing: true,
|
|
})
|
|
member_ids;
|
|
|
|
@fragment('fragment-managed-group-attributes', { defaultValue: {} })
|
|
attributes;
|
|
}
|