From 846414f44517c3c6fed45f3db52eb5d0dd07014b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 22 Jan 2014 15:08:59 +0100 Subject: [PATCH] Fixed sortBy(). --- .../javascripts/app/models/_application_model.js.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/models/_application_model.js.coffee b/app/assets/javascripts/app/models/_application_model.js.coffee index bbd685042..24a1f8994 100644 --- a/app/assets/javascripts/app/models/_application_model.js.coffee +++ b/app/assets/javascripts/app/models/_application_model.js.coffee @@ -258,10 +258,11 @@ class App.Model extends Spine.Model attribute = 'displayName' # check if displayName exists - if attribute is 'displayName' && item.displayName - return item.displayName().toLowerCase() - else - attribute = 'name' + if attribute is 'displayName' + if item.displayName + return item.displayName().toLowerCase() + else + attribute = 'name' return '' if item[ attribute ] is undefined return '' if item[ attribute ] is null