summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/cart.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/cart.rb b/app/models/cart.rb
index b08fc13..87e91d3 100644
--- a/app/models/cart.rb
+++ b/app/models/cart.rb
@@ -7,7 +7,7 @@ class Cart < ApplicationRecord
has_many :products, through: :product_carts
def delete_product(product_id)
- relation = product_carts.find_by(product_id:, cart_id:)
+ relation = ProductCart.find_by(product_id:, cart_id: id)
return false if relation.nil?