This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
hymenobacterdotinfo/app/models/strain.js
Matthew Dillon 007de178d8 Drop soft delete
Fixes #19.
2015-10-13 16:33:34 -07:00

31 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'),
createdBy : DS.attr('number'),
updatedBy : 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(),
});