From 0207cfe0e89af0eb7529ebeb57e74c01eba64ea6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 2 Nov 2014 20:45:22 +0100 Subject: [PATCH] Improved sort, only use lower if attribute is a string. --- .../javascripts/app/models/_application_model.js.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 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 9b62f1c56..2226bdb6c 100644 --- a/app/assets/javascripts/app/models/_application_model.js.coffee +++ b/app/assets/javascripts/app/models/_application_model.js.coffee @@ -553,8 +553,11 @@ class App.Model extends Spine.Model return '' if item[ attribute ] is undefined return '' if item[ attribute ] is null - # return value - item[ attribute ].toLowerCase() + # return value if string + if item[ attribute ].toLowerCase + return item[ attribute ].toLowerCase() + + item[ attribute ] ) @_order: ( collection, attribute ) ->