33 lines
1.3 KiB
JavaScript
33 lines
1.3 KiB
JavaScript
import DS from 'ember-data';
|
|
import Ember from 'ember';
|
|
|
|
export default DS.Model.extend({
|
|
measurements : DS.hasMany('measurements', { async: false }),
|
|
characteristics : DS.hasMany('characteristics', { async: false }),
|
|
species : DS.belongsTo('species', { async: false }),
|
|
strainName : DS.attr('string'),
|
|
typeStrain : DS.attr('boolean'),
|
|
accessionNumbers : DS.attr('string'),
|
|
genbank : DS.attr('string'),
|
|
wholeGenomeSequence: DS.attr('string'),
|
|
isolatedFrom : DS.attr('string'),
|
|
notes : DS.attr('string'),
|
|
createdAt : DS.attr('date'),
|
|
updatedAt : DS.attr('date'),
|
|
deletedAt : DS.attr('date'),
|
|
createdBy : DS.attr('number'),
|
|
updatedBy : DS.attr('number'),
|
|
deletedBy : DS.attr('number'),
|
|
totalMeasurements : DS.attr('number'),
|
|
sortOrder : DS.attr('number'),
|
|
canEdit : DS.attr('boolean'),
|
|
|
|
strainNameMU: function() {
|
|
let type = this.get('typeStrain') ? '<sup>T</sup>' : '';
|
|
return Ember.String.htmlSafe(`${this.get('strainName')}${type}`);
|
|
}.property('strainName', 'typeStrain').readOnly(),
|
|
|
|
fullNameMU: function() {
|
|
return Ember.String.htmlSafe(`<em>${this.get('species.speciesName')}</em> ${this.get('strainNameMU')}`);
|
|
}.property('species', 'strainNameMU').readOnly(),
|
|
});
|