ex05/acme/app/models/product.rb
# ensure that there are no line items referencing this product 
ensure that there are no line items referencing this product
ensure that there are no line items referencing this product
def ensure_not_referenced_by_any_cart_item
    unless cart_items.empty?
      errors.add(:base, 'Cart Items present')
      throw :abort
    end
  end
def ensure_not_referenced_by_any_cart_item unless cart_items . empty? errors . add ( :base , 'Cart Items present' ) throw :abort end end
ensure that there are no line items referencing this product
ensure that there are no line items referencing this product