melonhead901 / lab-specimen-transport-system

Automatically exported from code.google.com/p/lab-specimen-transport-system
0 stars 0 forks source link

Errors when users are deleted #115

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Notice! Broken functionality exposed by integration tests! Oh no!

What steps will reproduce the problem?
1. Remove a user who has commented on an item
2. Go back to that item
3. Rails takes a dump (500 error)

What is the expected output? What do you see instead?
Should just (A) remove the comment from the specimen or (B) handle a nil user 
reference. If A, put this in User.after_destroy

Original issue reported on code.google.com by rockina...@gmail.com on 24 May 2011 at 11:26

GoogleCodeExporter commented 8 years ago
I would go with option B. I've already handled nil user references for checkins 
and the history, and this is basically the same thing. Also, a comment from a 
deleted user may still contain useful or important information. If we really 
want to delete comments when we delete a user, then this option should be 
available through a checkbox when a user is deleted.

ie. "check here to delete all comments by this user"

Original comment by liu.al...@gmail.com on 24 May 2011 at 11:43

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 33de3330e7ce.

Original comment by donovanh...@gmail.com on 24 May 2011 at 11:49

GoogleCodeExporter commented 8 years ago
Please verify.  I went with option B.  Since we want to keep audits of 
essentially everything, I feel reluctant to allow deleting comments.

I believe the only thing we allow actually deleting is Users...is that right?

Original comment by donovanh...@gmail.com on 24 May 2011 at 11:50

GoogleCodeExporter commented 8 years ago
That is correct. The fix looks good, and I see you improved my original 
implementation, too.

Original comment by liu.al...@gmail.com on 24 May 2011 at 11:53