Update code for newest ember-model

This commit is contained in:
Piotr Sarnacki 2013-09-06 19:37:06 +02:00
parent 408cce2d4f
commit 1594130ff3
3 changed files with 5 additions and 5 deletions

View File

@ -126,7 +126,7 @@ unless window.TravisApplication
if reference && options.skipIfExists
return
reference = type._referenceForId(hash.id)
reference = type._getOrCreateReferenceForId(hash.id)
if reference.record
reference.record.merge(hash)
else

View File

@ -9,7 +9,7 @@ Travis.FlashController = Ember.ArrayController.extend
@set('flashes', Ember.A())
content: (->
@get('unseenBroadcasts').concat(@get('flashes'))
@get('unseenBroadcasts').concat(@get('flashes')).filter (o) -> !!o
).property('unseenBroadcasts.length', 'flashes.length')
unseenBroadcasts: (->

View File

@ -86,10 +86,10 @@ Array.prototype.diff = (a) ->
@loadTheRest(key)
isAttribute: (name) ->
this.attributes.contains(name)
this.constructor.getAttributes().contains(name)
isRelationship: (name) ->
this.relationships.contains(name)
this.constructor.getRelationships().contains(name)
loadTheRest: (key) ->
# for some weird reason key comes changed to a string and for some weird reason it even is called with
@ -145,7 +145,7 @@ Array.prototype.diff = (a) ->
).property()
isRecordLoaded: (id) ->
!!@_referenceForId(id).record
!!@_getOrCreateReferenceForId(id).record
camelizeKeys: true