mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
a19c718e6c
no issue - the `Role.lowerCaseName` CP could throw an error when `name` was missing which caused the sidebar rendering to be aborted - adds a guard to ensure we aren't calling string methods on `null` or `undefined`
18 lines
489 B
JavaScript
18 lines
489 B
JavaScript
/* eslint-disable camelcase */
|
|
import Model from 'ember-data/model';
|
|
import attr from 'ember-data/attr';
|
|
import {computed} from '@ember/object';
|
|
|
|
export default Model.extend({
|
|
name: attr('string'),
|
|
description: attr('string'),
|
|
createdAtUTC: attr('moment-utc'),
|
|
updatedAtUTC: attr('moment-utc'),
|
|
createdBy: attr('number'),
|
|
updatedBy: attr('number'),
|
|
|
|
lowerCaseName: computed('name', function () {
|
|
return (this.name || '').toLocaleLowerCase();
|
|
})
|
|
});
|