working ember... again
This commit is contained in:
@@ -7,12 +7,12 @@ Qsupplier.App.List = DS.Model.extend
|
||||
has_active_orders: attr 'boolean'
|
||||
price: attr 'number'
|
||||
table_number: attr 'number'
|
||||
table: DS.belongsTo('Qsupplier.App.Table', inverse: 'active_list')
|
||||
orders: DS.hasMany('Qsupplier.App.Order')
|
||||
section: DS.belongsTo('Qsupplier.App.Section')
|
||||
table: DS.belongsTo('table', inverse: 'active_list')
|
||||
orders: DS.hasMany('order')
|
||||
section: DS.belongsTo('section')
|
||||
section_id: attr('string')
|
||||
close: ->
|
||||
@get('orders').forEach (order)->
|
||||
order.close()
|
||||
@set('table', null)
|
||||
#@get('orders').forEach (order)->
|
||||
#order.close()
|
||||
#@set('table', null)
|
||||
@set('state', 'closed')
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
attr = DS.attr
|
||||
Qsupplier.App.Order = DS.Model.extend
|
||||
state: attr('string')
|
||||
list: DS.belongsTo('Qsupplier.App.List')
|
||||
list: DS.belongsTo('list')
|
||||
price: attr('number')
|
||||
product_orders: attr('object')
|
||||
section: DS.belongsTo('Qsupplier.App.Section')
|
||||
product_orders: attr()
|
||||
section: DS.belongsTo('section')
|
||||
section_id: attr('string')
|
||||
|
||||
active: (-> @get('state') == 'active').property('state')
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
attr = DS.attr
|
||||
Qsupplier.App.Product = DS.Model.extend
|
||||
order: DS.belongsTo('Qsupplier.App.Order')
|
||||
order: DS.belongsTo('order')
|
||||
|
||||
@@ -3,4 +3,4 @@ Qsupplier.App.Section = DS.Model.extend
|
||||
title: attr 'string'
|
||||
width: attr 'number'
|
||||
height: attr 'number'
|
||||
tables: DS.hasMany('Qsupplier.App.Table')
|
||||
tables: DS.hasMany('table')
|
||||
|
||||
@@ -6,5 +6,8 @@ Qsupplier.App.Table = DS.Model.extend
|
||||
position_x: attr 'number'
|
||||
position_y: attr 'number'
|
||||
occupied: attr 'boolean'
|
||||
section: DS.belongsTo('Qsupplier.App.Section')
|
||||
active_list: DS.belongsTo('Qsupplier.App.List')
|
||||
section: DS.belongsTo('section')
|
||||
active_list: DS.belongsTo('list')
|
||||
#active_list: (->
|
||||
#@get('list')
|
||||
#).property('list')
|
||||
|
||||
Reference in New Issue
Block a user