class Sprangular.User init: -> @addresses = @_extendAddress(@addresses) @billingAddress = @_extendAddress(@billing_address) @shippingAddress = @_extendAddress(@shipping_address) @orders = Sprangular.extend(@orders, Sprangular.Order) @creditCards = Sprangular.extend(@payment_sources, Sprangular.CreditCard) @allowOneClick = @creditCards.length > 0 && @addresses.length > 0 serialize: -> _.omit this, (value) -> typeof(value) == 'object' || typeof(value) == 'function' || Array.isArray(value) _extendAddress: (attrs) -> Sprangular.extend(attrs, Sprangular.Address)