Change account to Controller

This commit is contained in:
Piotr Sarnacki 2015-05-08 14:44:36 +02:00
parent 8b333c09fa
commit 394e9ce11b
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
`import Ember from 'ember'` `import Ember from 'ember'`
Controller = Ember.ObjectController.extend Controller = Ember.Controller.extend
allHooks: [] allHooks: []
needs: ['currentUser'] needs: ['currentUser']
userBinding: 'controllers.currentUser' userBinding: 'controllers.currentUser'
@ -21,7 +21,7 @@ Controller = Ember.ObjectController.extend
hook.toggle() hook.toggle()
reloadHooks: -> reloadHooks: ->
if login = @get('login') if login = @get('model.login')
hooks = @store.find('hook', all: true, owner_name: login) hooks = @store.find('hook', all: true, owner_name: login)
hooks.then () -> hooks.then () ->
@ -49,7 +49,7 @@ Controller = Ember.ObjectController.extend
billingUrl: (-> billingUrl: (->
id = if @get('model.type') == 'user' then 'user' else @get('model.login') id = if @get('model.type') == 'user' then 'user' else @get('model.login')
"#{@get('config').billingEndpoint}/subscriptions/#{id}" "#{@config.billingEndpoint}/subscriptions/#{id}"
).property('model.login', 'model.type') ).property('model.login', 'model.type')
`export default Controller` `export default Controller`

View File

@ -5,7 +5,7 @@ Controller = Ember.Controller.extend
needs: ['currentUser', 'accounts', 'account'] needs: ['currentUser', 'accounts', 'account']
userBinding: 'controllers.currentUser' userBinding: 'controllers.currentUser'
accountBinding: 'controllers.account' accountBinding: 'controllers.account.model'
activate: (action, params) -> activate: (action, params) ->
this["view_#{action}".camelize()]() this["view_#{action}".camelize()]()