App.ApplicationController = Ember.Controller.extend
  #init: ->
    #success = (supplier)=>
      ## A supplier record with id current and with the content of the returned supplier is created
      ## at the moment remove the dummy supplier, this should be resolved by Ember eventually
      #if error_supplier = @store.peekAll('supplier').findBy('id', 'current')
        #error_supplier.eraseRecord()
      #@set 'supplier', supplier

    #error = (emberError)=>
      #if error_supplier = @store.peekAll('supplier').findBy('id', 'current')
        #error_supplier.eraseRecord()
      #@set 'supplier', null
    #@store.findRecord('supplier', 'current').then success, error
    # @set 'supplier', @store.findRecord('supplier', supplier_id)
  #current_employee: (-> @get('employee') ).property('employee')
  actions:
    signOut: ->
      window.location = Routes.destroy_employee_session_path()
    showSupplierStatusInfo: ->
      @modal 'supplier_status_info',
        model: @get('globals.current_supplier')
        title_path: 'supplier_status_info.title'
