On Apr 1, 3:53 pm, Ramon Leon <[email protected]> wrote: > On 04/01/2011 03:03 AM, Michael Pavling wrote: > > > So yes, it probably would make more sense to have .save return false > > or raise on saving a destroyed record - but it should raise if you try > > to alter a destroyed record, and it makes not much sense to save a > > record you've destroyed and not altered... :-/ > > > I don't know which way to plump... any thoughts? > > Or.. make save work. Why should a deleted record be any different than > a new unsaved record? When a record is destroyed it should lose its id > and if saved again should insert a new row. At least, that's what I'd > expect, if the principle of least surprise means anything. >
That sounds dangerous to me. If someone decided to destroy a record, resurrecting it because in a narrow window of opportunity someone tried to update it sounds like it would lead to very difficult to track down bugs. For save to fail/raise an exception would be less dangerous Fred > -- > Ramon Leon -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

