attr = DS.attr
App.Table = DS.Model.extend
  number: attr 'number', defaultValue: 0
  width: attr 'number', defaultValue: 0.8
  height: attr 'number', defaultValue: 0.8
  position_x: attr 'number'
  position_y: attr 'number'
  # occupied: attr 'boolean'
  section: DS.belongsTo('section', async: false)
  #active_list: DS.belongsTo('list', key: 'active_list')
  active_list: DS.belongsTo('list', async: true)
  #list: DS.belongsTo('list')
  #active_list: (->
    #@get('list')
  #).property('list')
  occupied: (-> !!@get('active_list')).property('active_list.id')

  # Casted number to use in sortBy because a numberField will
  # set property number to string value (TablesIndexController)
  casted_number: (-> parseInt(@get('number'))).property('number')
  table_number: Ember.computed.alias('number')
