Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

If we destroy a cart, then we destroy all items in the cart as well.

  • Loading branch information...
commit 5cacfd91f5e172f82a89486c8f8ffd696d4e9849 1 parent e88c420
Fred Wu authored
2  lib/active_record/acts/shopping_cart.rb
@@ -18,7 +18,7 @@ module ClassMethods
18 18
         #
19 19
         def acts_as_shopping_cart_using(item_class)
20 20
           self.send :include, ActiveRecord::Acts::ShoppingCart::InstanceMethods
21  
-          has_many :cart_items, :class_name => item_class.to_s.classify, :as => :cart
  21
+          has_many :cart_items, :class_name => item_class.to_s.classify, :as => :cart, :dependent => :destroy
22 22
         end
23 23
 
24 24
         #

0 notes on commit 5cacfd9

Please sign in to comment.
Something went wrong with that request. Please try again.