I'd do this at the end of the method - you're intermingling setting instance variables (like `@products = cart.products`) with updating the DB. Set all the instance variables first, then do this line at the end.