From 89546a09a28037782047b542173efa01c06f4430 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 27 Aug 2015 23:00:38 +0200 Subject: [PATCH] Fixed @_fillUp(), improved protection for endless loops. --- app/assets/javascripts/app/models/_application_model.js.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/models/_application_model.js.coffee b/app/assets/javascripts/app/models/_application_model.js.coffee index f1f06f60d..01af418c8 100644 --- a/app/assets/javascripts/app/models/_application_model.js.coffee +++ b/app/assets/javascripts/app/models/_application_model.js.coffee @@ -545,9 +545,8 @@ class App.Model extends Spine.Model # only if relation record exists in collection if App[ attribute.relation ].exists( data[attribute.name] ) - classNames.push @className item = App[ attribute.relation ].find( data[attribute.name] ) - item = App[ attribute.relation ]._fillUp(item, classNames) + item = App[ attribute.relation ]._fillUp(item, classNames.concat(@className)) data[ withoutId ] = item else console.log("ERROR, cant find #{ attribute.name } App.#{ attribute.relation }.find(#{ data[attribute.name] }) for '#{ data.constructor.className }' #{ data.displayName() }")