Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. question
- def find_cart
- cart = Cart.find_by(id: session[:cart_id])
- unless cart.present?
- cart = Cart.create
- end
- session[:cart_id] = cart.id
- cart
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement