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)


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

def active?
  !paid?
end

#total_weightObject



15
16
17
18
19
# File 'app/models/stall/models/cart.rb', line 15

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