Update code for newest ember-model
This commit is contained in:
parent
408cce2d4f
commit
1594130ff3
|
@ -126,7 +126,7 @@ unless window.TravisApplication
|
||||||
if reference && options.skipIfExists
|
if reference && options.skipIfExists
|
||||||
return
|
return
|
||||||
|
|
||||||
reference = type._referenceForId(hash.id)
|
reference = type._getOrCreateReferenceForId(hash.id)
|
||||||
if reference.record
|
if reference.record
|
||||||
reference.record.merge(hash)
|
reference.record.merge(hash)
|
||||||
else
|
else
|
||||||
|
|
|
@ -9,7 +9,7 @@ Travis.FlashController = Ember.ArrayController.extend
|
||||||
@set('flashes', Ember.A())
|
@set('flashes', Ember.A())
|
||||||
|
|
||||||
content: (->
|
content: (->
|
||||||
@get('unseenBroadcasts').concat(@get('flashes'))
|
@get('unseenBroadcasts').concat(@get('flashes')).filter (o) -> !!o
|
||||||
).property('unseenBroadcasts.length', 'flashes.length')
|
).property('unseenBroadcasts.length', 'flashes.length')
|
||||||
|
|
||||||
unseenBroadcasts: (->
|
unseenBroadcasts: (->
|
||||||
|
|
|
@ -86,10 +86,10 @@ Array.prototype.diff = (a) ->
|
||||||
@loadTheRest(key)
|
@loadTheRest(key)
|
||||||
|
|
||||||
isAttribute: (name) ->
|
isAttribute: (name) ->
|
||||||
this.attributes.contains(name)
|
this.constructor.getAttributes().contains(name)
|
||||||
|
|
||||||
isRelationship: (name) ->
|
isRelationship: (name) ->
|
||||||
this.relationships.contains(name)
|
this.constructor.getRelationships().contains(name)
|
||||||
|
|
||||||
loadTheRest: (key) ->
|
loadTheRest: (key) ->
|
||||||
# for some weird reason key comes changed to a string and for some weird reason it even is called with
|
# 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()
|
).property()
|
||||||
|
|
||||||
isRecordLoaded: (id) ->
|
isRecordLoaded: (id) ->
|
||||||
!!@_referenceForId(id).record
|
!!@_getOrCreateReferenceForId(id).record
|
||||||
|
|
||||||
camelizeKeys: true
|
camelizeKeys: true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user