Qsupplier.App.TablesIndexController = Ember.ArrayController.extend
  tables: (-> @get('model').sortBy('casted_number')).property('model.@each.number')
  actions:
    editTable: (table)->
      @modal 'edit_table',
        model: table
        ok: ->
          table.save()
        close: ->
          table.rollback()
    destroyTable: (table)->
      @send 'confirm',
        title: t('table.destroy.modal.title', number: table.get('number'))
        ok: -> table.destroy()
