remove denormalization of lists and orders towards the section

This commit is contained in:
2015-10-12 15:25:58 +02:00
parent a6c74f1872
commit 86e518890f
5 changed files with 22 additions and 27 deletions
@@ -6,7 +6,7 @@ App.IndexController = Ember.Controller.extend
orders: Ember.computed -> @store.peekAll('order')
sections: Ember.computed -> @store.peekAll('section')
#active_section: Ember.computed.alias 'globals.active_section'
active_lists: Ember.computed 'lists.@each.state', 'globals.active_section.id', 'lists.@each.table', ->
active_lists: Ember.computed 'lists.@each.state', 'globals.active_section.id', 'lists.@each.table', -> # table needed for when list changes table
@get('orders') # trigger orders, otherwise observers are not initialized/triggered (active_orders)
if section_id = @get('globals.active_section.id')
lists = @get('lists').filter (l)=>( l.get('table.section.id') == section_id && l.get('state') == 'active' )