jdl the answer is correct - you need to add :dependent => :destroyto both relationships - that is, in your class User, add it to has_many :orders, and in your class Orderadd it to has_many :order_items.
You can also change the behavior of MySQL on foreign keys, perhaps by setting them to ON DELETE CASCADE.