search for: quote_input

Displaying 2 results from an estimated 2 matches for "quote_input".

2007 Jan 19
0
Do transactions fail with polymorphic has_one relationships?
...an AR::Base descendant with a complex object graph beneath it, like so: ArtisanQuoteInput has_one QuoteInput and then QuoteInput has several objects attached to it. Note that the relationship between ArtisanQuoteInput and QuoteInput is polymorphic, so the relationship in A is written has_one :quote_input, :as => :program_quote_input If @artisan_quote_input is an instance of ArtisanQuoteInput and I call @artisan_quote_input.save!, and just one of its attributes is invalid (meaning that @artisan_quote_input fails validation), what I see is that the quote_input object and all of its children save...
2006 Oct 13
3
Validation errors in has_one/belongs_to relationships.
...d to a QuoteInput. The Insured object has invalid data. I call save! on the quote input. QuoteInput has no validations. I expect two things to happen - 1) an exception should be thrown, indicating that there was a problem saving the child object, and 2) an error message should be added to the quote_input object''s error message array to indicate an error saving the child (Insured) object. I know that the validation works on the insured object alone if I create one and attempt to save it with invalid data. Why does qi.save! return true below? It''s like it didn''t try to...