travis-web/app/routes/accounts/index.coffee
2015-02-03 09:48:22 +01:00

13 lines
445 B
CoffeeScript

`import TravisRoute from 'travis/routes/basic'`
Route = TravisRoute.extend
redirect: ->
# TODO: setting accounts model in ProfileRoute is wrong, but
# at this stage it's better than what we had before
accounts = @modelFor('accounts')
login = @controllerFor('currentUser').get('login')
account = accounts.find (account) -> account.get('login') == login
@replaceWith 'account', account
`export default Route`