Displaying 1 result from an estimated 1 matches for "quotelineitem".
Did you mean:
quote_line_item
2006 Aug 12
0
insert into database failing
...ample 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.save # <---- error occurs here
@cart.empty!
redirect_to_index(...