UNPKG

wejsv2old-plugin-rating

Version:
51 lines (46 loc) 1.26 kB
App.Router.map(function () { // avaliações this.resource('ratings', function () { // criar gerenciador this.route('criar'); // editar gerenciador this.route('editar', { path: '/:rm/editar' }); }); }); App.RatingsRoute = Ember.Route.extend({ model: function () { return Ember.RSVP.hash({ vocabularies: this.store.find('vocabulary'), ratingmanagers: this.store.find('ratingmanager') }); } }); App.RatingsCriarRoute = Ember.Route.extend({ model: function () { return Ember.RSVP.hash({ vocabulary: this.modelFor('ratings').vocabularies, ratingmanager: this.modelFor('ratings').ratingmanagers, models: (function () { var models = []; for (var key in App) { var value = App[key], superClass = value ? value.superclass : undefined; if (superClass && superClass === DS.Model) { models.push(key.toLowerCase()); } } return models; }()) }); } }); App.RatingsEditarRoute = Ember.Route.extend({ model: function (params) { return Ember.RSVP.hash({ vocabulary: this.modelFor('ratings').vocabularies, manager: this.store.findById('ratingmanager', params.rm) }); } });