Cleaning up measurement edit

This commit is contained in:
Matthew Dillon 2015-09-16 12:45:06 -07:00
parent 40f2b789e4
commit 4b6a776b63
6 changed files with 29 additions and 42 deletions

View file

@ -3,9 +3,7 @@ import DS from 'ember-data';
export default DS.Model.extend({
strain : DS.belongsTo('strain', { async: false }),
characteristic : DS.belongsTo('characteristic', { async: false }),
textMeasurementType: DS.attr('string'),
txtValue : DS.attr('string'),
numValue : DS.attr('number'),
value : DS.attr('string'),
confidenceInterval : DS.attr('number'),
unitType : DS.attr('string'),
notes : DS.attr('string'),
@ -14,17 +12,4 @@ export default DS.Model.extend({
updatedAt : DS.attr('date'),
createdBy : DS.attr('number'),
updatedBy : DS.attr('number'),
value: function() {
if (this.get('textMeasurementType')) {
return this.get('textMeasurementType');
}
if (this.get('txtValue')) {
return this.get('txtValue');
}
if (this.get('numValue')) {
return this.get('numValue');
}
return "error";
}.property('textMeasurementType', 'txtValue', 'numValue'),
});