Displaying 1 result from an estimated 1 matches for "quote_line_items".
2006 Aug 12
0
insert into database failing
...ing a little project based on the agile book''s shopping cart
example and have hit a problem. the inserts are failing when saving a
quote which contains line_items. the models are as follows
(quote_line_item is using single table inheritance):
class Quote < ActiveRecord::Base
has_many :quote_line_items
end
class LineItem < ActiveRecord::Base
end
class QuoteLineItem < LineItem
belongs_to :quote
belongs_to :product
end
the section of code that actually fails is here (labelled)
def send_quote
@quote = Quote.new(params[:quote])
@quote.quote_line_items << @cart.items
if @quote.sav...