Is there a way to not have an attribute option appear if the stock for that option is zero? Rather than have the customer sent to the cart and then find out it is not available...

ie product AA has 3 options: small, medium & large. Stock values are : 1, 0, 1 respectively. Ideally the selections presented on the product page are: small and large as that is all that is in stock.