In my experience exceptions result in 500 errors and no message to the user.
In this case the issue is that it is assigning to the association and not explicitly removing the deleted records or checking their errors. My client wants to see the reason the records were not deleted as with any other validation error. Michael Sent from my iPad On Apr 18, 2011, at 1:35 AM, "Sergio Cambra .:: entreCables S.L. ::." <[email protected]> wrote: > On Domingo, 17 de Abril de 2011 02:05:48 Michael Latta escribió: >> I have another case that appears to fail for association subforms: >> >> 1) The association is :dependent => :destroy >> 2) The destroy on the child record fails (returns false, and sets an error >> on the record). >> >> The update completes, does not report any errors to the user, but the >> record is neither destroyed or removed from the association. When the >> user opens the record again the "deleted" subform is back. > > Usually you prevents destroying a record raising an exception. ActiveScaffold > set warning flash message when exception is raised, and sets successful to > false. Moving flash message out of rescue block and setting it when > successful > is false should work your problem. > >> >> I will be fixing this in my fork of the rails 3 fork. I expect to add >> testing on association updates to detect this and some other failing cases >> and report errors accordingly. If there are any other issues to be >> addressed at the same time of the same nature I would welcome input so the >> update improvements can cover as many cases as possible. I would also >> welcome some pointers to the test cases being used for AS that deal with >> updates and any guidelines on updating test cases for pull requests. >> >> Michael > > -- > Sergio Cambra .:: entreCables S.L. ::. > Mariana Pineda 23, 50.018 Zaragoza > T) 902 021 404 F) 976 52 98 07 E) [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en. > -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.
