Esto es lo que aparece en consola
irb(main):016:0> ShoppingCart.last ShoppingCart Load (0.3ms) SELECT "shopping_carts".* FROM "shopping_carts" ORDER BY "shopping_carts"."id" DESC LIMIT ? [["LIMIT", 1]] => #<ShoppingCart id: 3, status: "payed", ip: "::1", created_at: "2021-06-17 23:05:53.141283000 +0000", updated_at: "2021-06-17 23:53:43.260973000 +0000", delivery_method: nil, shipping: 0.0> irb(main):017:0> ShoppingCart.last.destroy ShoppingCart Load (0.3ms) SELECT "shopping_carts".* FROM "shopping_carts" ORDER BY "shopping_carts"."id" DESC LIMIT ? [["LIMIT", 1]] TRANSACTION (0.1ms) begin transaction ShoppingCart Destroy (6.6ms) DELETE FROM "shopping_carts" WHERE "shopping_carts"."id" = ? [["id", 3]] TRANSACTION (2.4ms) rollback transaction Traceback (most recent call last): 1: from (irb):17 ActiveRecord::InvalidForeignKey (SQLite3::ConstraintException: FOREIGN KEY constraint failed)