Check if key is defined in incomplete checks
This commit is contained in:
parent
baa95d590d
commit
eef8e55cfe
|
@ -35,7 +35,8 @@
|
|||
@get 'isLoaded'
|
||||
).property('incomplete', 'isLoaded')
|
||||
|
||||
loadTheRest: ->
|
||||
loadTheRest: (key) ->
|
||||
console.log 'Load missing fields for', @constructor, "because of missing key '#{key}'"
|
||||
return if @get('isCompleting')
|
||||
@set 'isCompleting', true
|
||||
|
||||
|
|
6
assets/scripts/vendor/ember-data.js
vendored
6
assets/scripts/vendor/ember-data.js
vendored
|
@ -3255,7 +3255,7 @@ DS.attr = function(type, options) {
|
|||
return Ember.computed(function(key, value) {
|
||||
var data;
|
||||
|
||||
if(arguments.length === 1 && this.constructor.isAttribute(key) && get(this, 'incomplete') && !this.isAttributeLoaded(key)) {
|
||||
if(arguments.length === 1 && key && this.constructor.isAttribute(key) && get(this, 'incomplete') && !this.isAttributeLoaded(key)) {
|
||||
if(this.loadTheRest) {
|
||||
this.loadTheRest(key);
|
||||
}
|
||||
|
@ -3395,7 +3395,7 @@ var hasAssociation = function(type, options, one) {
|
|||
var data = get(this, 'data'), ids, id, association,
|
||||
store = get(this, 'store');
|
||||
|
||||
if(arguments.length === 1 && this.constructor.isAttribute(key) && get(this, 'incomplete') && !this.isAttributeLoaded(key)) {
|
||||
if(arguments.length === 1 && key && this.constructor.isAttribute(key) && get(this, 'incomplete') && !this.isAttributeLoaded(key)) {
|
||||
if(this.loadTheRest) {
|
||||
this.loadTheRest(key);
|
||||
}
|
||||
|
@ -3463,7 +3463,7 @@ var hasAssociation = function(type, options) {
|
|||
store = get(this, 'store'),
|
||||
ids, id, association;
|
||||
|
||||
if(arguments.length === 1 && this.constructor.isAttribute(key) && get(this, 'incomplete') && !this.isAttributeLoaded(key)) {
|
||||
if(arguments.length === 1 && key && this.constructor.isAttribute(key) && get(this, 'incomplete') && !this.isAttributeLoaded(key)) {
|
||||
if(this.loadTheRest) {
|
||||
this.loadTheRest(key);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user