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)


23
24
25
# File 'app/models/stall/models/cart.rb', line 23

def active?
  !paid?
end

#total_weightObject



17
18
19
20
21
# File 'app/models/stall/models/cart.rb', line 17

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