ActiveRecord::Base
# File app/models/cart.rb, line 4
4: def add_product(product_id)
5: current_item = line_items.find_by_product_id(product_id)
6: if current_item
7: current_item.quantity += 1
8: else
9: current_item = line_items.build(:product_id => product_id)
10: end
11: current_item
12: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.