Skip to content

Instantly share code, notes, and snippets.

@svasva
Created November 7, 2013 12:04
Show Gist options
  • Save svasva/7353555 to your computer and use it in GitHub Desktop.
Save svasva/7353555 to your computer and use it in GitHub Desktop.
balance: (->
@store.find('balance', {currency: @get('id')}).then (data) ->
return data.get('firstObject')
).property()
@abuiles
Copy link

abuiles commented Nov 7, 2013

  App.CurrentyRoute = Ember.Route.extend
    setupController: (controller, model) ->
      @store.find('balance', {currency: model.get('id')}).then (data) ->
        return controller.set('balance', data.get('firstObject'))

  App.CurrencyController =  Ember.ObjectController.extend
    balance: null

@abuiles
Copy link

abuiles commented Nov 7, 2013

balance: (->
  proxy = Ember.ObjectProxy.create()
  @store.find('balance', {currency: @get('id')}).then (data) ->
    proxy.set('content', data.get('firstObject'))
  proxy
).property()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment