This commit is contained in:
Sven Fuchs 2012-07-23 13:25:21 +02:00
parent c3b0d5751c
commit 4bdbca9c55
3 changed files with 14 additions and 16 deletions

View File

@ -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

View File

@ -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,8 +45,8 @@ 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']

File diff suppressed because one or more lines are too long