foo
This commit is contained in:
parent
c3b0d5751c
commit
4bdbca9c55
|
@ -27,8 +27,7 @@ $.extend Travis.Pusher.prototype,
|
|||
|
||||
receive: (event, data) ->
|
||||
data = @normalize(event, data) if data.id
|
||||
# console.log(event, data)
|
||||
Travis.app.store.loadData(event, data)
|
||||
Travis.app.store.receive(event.split(':')[0], data)
|
||||
|
||||
normalize: (event, data) ->
|
||||
switch event
|
||||
|
|
|
@ -4,9 +4,8 @@ Travis.Store = DS.Store.extend
|
|||
revision: 4
|
||||
adapter: Travis.RestAdapter.create()
|
||||
|
||||
loadData: (event, data) ->
|
||||
receive: (name, data) ->
|
||||
mappings = @adapter.get('mappings')
|
||||
name = event.split(':').shift()
|
||||
type = mappings[name]
|
||||
|
||||
if data[type.singularName()]
|
||||
|
@ -46,15 +45,15 @@ Travis.Store = DS.Store.extend
|
|||
# ids.pushObject(data.id) unless data.id in ids
|
||||
# parent.send('didChangeData');
|
||||
|
||||
_updateAssociations: (type, name, data) ->
|
||||
clientId = @typeMapFor(Travis.Repository).idToCid[data['repository_id']]
|
||||
# _updateAssociations: (type, name, data) ->
|
||||
# clientId = @typeMapFor(Travis.Repository).idToCid[data['repository_id']]
|
||||
|
||||
# associations = Em.get(type, 'associationsByName')
|
||||
# console.log [type, meta.type, meta.kind, meta.kind == 'belongsTo']
|
||||
# if meta.kind == 'belongsTo'
|
||||
# id = data["#{key}_id"]
|
||||
# if parent = this.findByClientId(meta.type, clientId, id)
|
||||
# data = parent.get('data')
|
||||
# if ids = data.get("#{name}_ids")
|
||||
# ids.pushObject(data.id) unless data.id in ids
|
||||
# parent.send('didChangeData')
|
||||
# associations = Em.get(type, 'associationsByName')
|
||||
# console.log [type, meta.type, meta.kind, meta.kind == 'belongsTo']
|
||||
# if meta.kind == 'belongsTo'
|
||||
# id = data["#{key}_id"]
|
||||
# if parent = this.findByClientId(meta.type, clientId, id)
|
||||
# data = parent.get('data')
|
||||
# if ids = data.get("#{name}_ids")
|
||||
# ids.pushObject(data.id) unless data.id in ids
|
||||
# parent.send('didChangeData')
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user