From 61110336bc5a924346f0654cb5bb812101c3bc7a Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 6 Apr 2023 14:53:02 -0600 Subject: AƱade specs de cxarts_controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/cart.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/cart.rb') 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? -- cgit v1.2.3