Module: Stall::Models::Cart

Extended by:
ActiveSupport::Concern
Included in:
Cart
Defined in:
app/models/stall/models/cart.rb

Instance Method Summary collapse

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/models/stall/models/cart.rb', line 25

def active?
  !paid?
end

#total_weightObject



19
20
21
22
23
# File 'app/models/stall/models/cart.rb', line 19

def total_weight
  line_items.reduce(0) do |total, line_item|
    total + (line_item.weight || Stall.config.default_product_weight)
  end
end