What should happen when a user is deleted? #66

jordanbyron opened this Issue Jul 26, 2012 · 2 comments


None yet
2 participants

jordanbyron commented Jul 26, 2012

Currently if a user is deleted their comments, shared articles, and @ mentions are abandoned. In general users should never be deleted, but it appears there is a case were that has happend (User#id == 53) in production. Now that user's share links are failing.

I see a few ways forward:

  1. Delete that user's shared article links and add :dependent => : destroy to the has_many :shared_articles relationship. A similar approach could be taken for comments, and we'd have to do some fancy footwork to invalidate caches where the user was mentioned.
  2. Systematically disable the ability to delete users and instead forcing administrators to disable accounts.

Personally I am not too crazy about the first approach. I want those share links to keep working and all user's comments to remain intact. A nice compromise for User #53 might be to assign their share links to @sandal or @jordanbyron.


practicingruby commented Jul 26, 2012

@jordanbyron : Definitely #2. Users have only been deleted in very exceptional circumstances, and it sucks when that happens. Go ahead and assign #53 to one of us.


jordanbyron commented Jul 26, 2012

@sandal I've reassigned User #53's shared articles to you. I'll keep this ticket open to remind me to add a warning to user deletion.

Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment