projects
/
depot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Finished iteration D.3 in chapter 9
[depot.git]
/
app
/
models
/
cart.rb
diff --git
a/app/models/cart.rb
b/app/models/cart.rb
index 0f1d52e731588dd79ac0bde3fe487761d93ad3be..88061d380470188dcf6991dcd5e0cdb3f966799d 100644
(file)
--- a/
app/models/cart.rb
+++ b/
app/models/cart.rb
@@
-10,8
+10,10
@@
class Cart
if current_item
current_item.increment_quantity
else
- @items << CartItem.new(product)
+ current_item = CartItem.new(product)
+ @items << current_item
end
+ current_item
end
def total_price