Defaulting cart count to zero if undefined

This commit is contained in:
Will Marshall
2014-06-06 14:47:12 +10:00
parent 2545b06b2d
commit 0c313c0dcb

View File

@@ -2,5 +2,7 @@ Darkswarm.factory 'CurrentOrder', (currentOrder) ->
new class CurrentOrder
constructor: ->
@[k] = v for k, v of currentOrder
@cart_count ?= 0
empty: =>
@line_items.length == 0