import DS from 'ember-data'
export default DS.Model.extend
  name:                      DS.attr('string')
  position:                  DS.attr('number')
  tracker_subject:           DS.belongsTo('panda/tracker-subject')
  tracker_items:             DS.hasMany('panda/tracker-item')
  workflow_groups: DS.hasMany('panda/workflow-group')

  trackerItemSort: ['position:asc']
  #sorted_tracker_items: Ember.computed.sort('tracker_items', 'trackerItemSort')
  sorted_tracker_items: Ember.computed 'tracker_items.@each.position', ->
    @get('tracker_items').sortBy('position')
