Last active
December 21, 2015 04:39
-
-
Save coderberry/6251354 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Cartridge = require('../models/cartridge'); | |
var CartridgeRoute = Ember.Route.extend({ | |
model: function(params) { | |
// `fetch` returns a promise when `find` does not | |
return Cartridge.fetch(params.uid).then(function(record) { | |
Ember.run.next(record, function() { | |
record.deserialize(); | |
}); | |
return record; | |
}) | |
}, | |
serialize: function(model) { | |
return { uid: model.get('uid') }; | |
} | |
}); | |
module.exports = CartridgeRoute; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment