Model relation fixes and mobile device improvements
This commit is contained in:
@@ -12,10 +12,9 @@ App.List = DS.Model.extend
|
||||
closed_at: DS.attr('date')
|
||||
users: DS.hasMany('user', async: false)
|
||||
#table_number: attr 'number'
|
||||
table: DS.belongsTo('table', inverse: 'active_list', async: false) # should be async, but synchroneously loading now fails with JSONAPI, this seems to work
|
||||
table: DS.belongsTo('table', inverse: 'active_list', async: true) # should be async, but synchroneously loading now fails with JSONAPI, this seems to work
|
||||
#users: DS.hasMany('user', inverse: 'active_list')
|
||||
orders: DS.hasMany('order', async: false)
|
||||
section: DS.belongsTo('section', async: false) # should be async, but synchroneously loading now fails with JSONAPI, this seems to work
|
||||
|
||||
# COMPUTED PROPERTIES
|
||||
active: Ember.computed.equal 'state', 'active'
|
||||
|
||||
@@ -6,7 +6,7 @@ App.Table = DS.Model.extend
|
||||
position_x: attr 'number'
|
||||
position_y: attr 'number'
|
||||
# occupied: attr 'boolean'
|
||||
section: DS.belongsTo('section')
|
||||
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')
|
||||
|
||||
@@ -4,7 +4,7 @@ App.User= DS.Model.extend
|
||||
uid: attr('string')
|
||||
provider: attr('string')
|
||||
avatar: attr('string')
|
||||
list: DS.belongsTo('list') # in ember scope not many to many (yet)
|
||||
lists: DS.hasMany('list') # in ember scope not many to many (yet)
|
||||
join_requests: DS.hasMany('join_request')
|
||||
avatar_tag: Ember.computed 'avatar', 'name', ->
|
||||
avatar = @get('avatar') || "#{$asset_path}/supplier/unknown-avatar.png"
|
||||
|
||||
Reference in New Issue
Block a user