Test new species (plus minor cleanup)
This commit is contained in:
parent
30e7000a81
commit
19ce579983
4 changed files with 21 additions and 1 deletions
|
@ -13,6 +13,7 @@ export function testConfig() {
|
|||
this.get('/users/:id');
|
||||
|
||||
this.get('/species');
|
||||
this.post('/species');
|
||||
this.get('/species/:id');
|
||||
this.put('/species/:id');
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export default Mixin.create({
|
|||
},
|
||||
|
||||
afterModel: function(model) {
|
||||
if (!model.get('canEdit')) {
|
||||
if (!model.get('isNew') && !model.get('canEdit')) {
|
||||
this.transitionTo(this.get('fallbackRouteAfter'), model.get('id'));
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,4 +7,9 @@ export default Route.extend(ElevatedAccess, {
|
|||
// Required for ElevatedAccess mixin
|
||||
fallbackRouteBefore: 'protected.species.index',
|
||||
fallbackRouteAfter: 'protected.species.show',
|
||||
|
||||
model: function(params) {
|
||||
return this.store.findRecord('species', params.species_id);
|
||||
},
|
||||
|
||||
});
|
||||
|
|
Reference in a new issue