From eef8e55cfe541727ce1a5e90677e616e625b776a Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 31 Oct 2012 14:56:17 +0100 Subject: [PATCH] Check if key is defined in incomplete checks --- assets/scripts/lib/travis/model.coffee | 3 ++- assets/scripts/vendor/ember-data.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/scripts/lib/travis/model.coffee b/assets/scripts/lib/travis/model.coffee index fa5722e2..6ef2e7dc 100644 --- a/assets/scripts/lib/travis/model.coffee +++ b/assets/scripts/lib/travis/model.coffee @@ -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 diff --git a/assets/scripts/vendor/ember-data.js b/assets/scripts/vendor/ember-data.js index 8e09d046..9a71e855 100644 --- a/assets/scripts/vendor/ember-data.js +++ b/assets/scripts/vendor/ember-data.js @@ -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); }