Working on deprecations
This commit is contained in:
parent
e91a283680
commit
7696b7008f
12 changed files with 29 additions and 18 deletions
|
@ -5,7 +5,7 @@ export default Ember.Controller.extend({
|
|||
save: function() {
|
||||
let strain = this.get('strain');
|
||||
|
||||
if (strain.get('isDirty')) {
|
||||
if (strain.get('hasDirtyAttributes')) {
|
||||
strain.save().then((strain) => {
|
||||
this.transitionToRoute('protected.strains.show', strain);
|
||||
}, (err) => {
|
||||
|
|
|
@ -3,9 +3,4 @@ import Ember from 'ember';
|
|||
export default Ember.Controller.extend({
|
||||
sortParams: ['fullNameMU', 'totalMeasurements'],
|
||||
sortedStrains: Ember.computed.sort('model', 'sortParams'),
|
||||
|
||||
metaData: function() {
|
||||
return Ember.copy(this.store.metadataFor('strain'));
|
||||
}.property('model.isLoaded').readOnly(),
|
||||
|
||||
});
|
||||
|
|
|
@ -4,4 +4,10 @@ export default Ember.Route.extend({
|
|||
model: function() {
|
||||
return this.store.findAll('strain');
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
controller.set('model', model);
|
||||
controller.set('metaData', this.store.metadataFor('strain'));
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
{{#each sortedStrains as |row|}}
|
||||
<tr>
|
||||
<td>
|
||||
{{#link-to 'protected.strains.show' row.id classBinding="data.typeStrain:type-strain"}}
|
||||
{{#link-to 'protected.strains.show' row classBinding="data.typeStrain:type-strain"}}
|
||||
{{row.fullNameMU}}
|
||||
{{/link-to}}
|
||||
</td>
|
||||
|
|
|
@ -5,7 +5,7 @@ export default Ember.Controller.extend({
|
|||
save: function() {
|
||||
let strain = this.get('strain');
|
||||
|
||||
if (strain.get('isDirty')) {
|
||||
if (strain.get('hasDirtyAttributes')) {
|
||||
strain.save().then((strain) => {
|
||||
this.transitionToRoute('protected.strains.show', strain);
|
||||
}, (err) => {
|
||||
|
|
Reference in a new issue