This file contains 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
`import Route from 'outreach/core/route'` | |
# Route which manages a transaction on it's content. | |
# E.g. when the route is exited, the transaction will | |
# be rolled back | |
class TransactionalRoute extends Route | |
resolveSession: (parentSession) -> | |
@session = parentSession.newSession() |
This file contains 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
`import CurrentUserMixin from 'outreach/core/current_user_mixin'` | |
`import Model from 'outreach/core/model'` | |
class Route extends Em.Route with CurrentUserMixin | |
+computed | |
title: -> | |
'Outreach' | |
enter: -> |
This file contains 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
Adapter.map(function() { | |
this.resources('post', {path: '/blog-posts/:post_id'}, function() { | |
this.resources('comments'); // assumes has-many called 'comments' and inverse called 'post' | |
this.resource('owner', {type: 'user'}); | |
}); | |
}); |
This file contains 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
`import CurrentUserMixin from 'outreach/core/current_user_mixin'` | |
class Route extends Em.Route with CurrentUserMixin | |
beforeModel: (transition) -> | |
parentRoute = if transition.state.handlerInfos.length > 1 | |
transition.state.handlerInfos[transition.state.handlerInfos.length - 2].handler | |
else | |
null | |
@setupSession(parentRoute) |
NewerOlder