search for: for_dish

Displaying 1 result from an estimated 1 matches for "for_dish".

2006 Feb 27
2
Find not working
...have the following code (taken from the depot tutorial then modified) def add_dish( dish, type, qnty ) item = @items.find {|i| i.dish_id == dish.id && i.type == type } if item item.quantity += qnty.to_i else if type == ''Fresh'' item = Fresh.for_dish(dish) else item = Frozen.for_dish(dish) end item.order_id = 1 item.quantity = qnty.to_i @items << item end @total_price += (dish.price * qnty.to_i) end The problem line is this: item = @items.find {|i| i.dish_id == dish.id && i.type =...