Upgrades and fixes, maintenance
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
Qsupplier.App.ApplicationRoute = Ember.Route.extend
|
||||
beforeModel: ->
|
||||
# Preload only active lists and orders
|
||||
@store.find 'product_category'
|
||||
#@store.find 'order', state: 'active' included in list
|
||||
setupController: (controller)->
|
||||
controller.set 'product_categories', @store.find('product_category')
|
||||
@store.find 'list', state: 'active'
|
||||
controller.set 'product_categories', @store.all('product_category')
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
Qsupplier.App.IndexRoute = Ember.Route.extend
|
||||
model: (params, queryParams)->
|
||||
# Preload only active lists and orders
|
||||
@store.find 'list', state: 'active'
|
||||
@store.find 'order', state: 'active'
|
||||
Ember.Object.create
|
||||
# Find with condition does not work since the resulting array promise is not updated for newly created records
|
||||
#lists: Qsupplier.App.List.find({state: 'active'})
|
||||
#orders: Qsupplier.App.Order.find({state: 'active'})
|
||||
#lists: @store.filter 'list', (l)-> l.get('state') == 'active' # DOES NOT WORK!!!! (yet)
|
||||
# use filter to create a scope on all the records
|
||||
lists: @store.filter 'list', -> true
|
||||
#lists: @store.filter 'list', -> true
|
||||
lists: @store.all 'list'
|
||||
# mayby @store.all 'list' will work better!!!! (2014-04-24 a more experienced benjamin :)
|
||||
orders: @store.filter 'order', -> true
|
||||
#orders: @store.filter 'order', -> true
|
||||
orders: @store.all 'order'
|
||||
sections: @store.find 'section'
|
||||
setupController: (controller, model)->
|
||||
controller.set('model', model)
|
||||
|
||||
Reference in New Issue
Block a user