File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,12 +60,19 @@ def bot?
6060 bot
6161 end
6262
63- def hard_delete
64- points . update_all user_id : 1 # change to anonymous account id
65- return unless PointComment . where user_id : id
63+ before_destroy :hard_delete
6664
67- comments = PointComment . where user_id : id
68- comments . update_all user_id : 1
65+ def hard_delete
66+ anonymous_id = 1
67+ points . update_all user_id : anonymous_id
68+ documents . update_all user_id : anonymous_id
69+ services . update_all user_id : anonymous_id
70+ point_comments . update_all user_id : anonymous_id
71+ case_comments . update_all user_id : anonymous_id
72+ document_comments . update_all user_id : anonymous_id
73+ service_comments . update_all user_id : anonymous_id
74+ topic_comments . update_all user_id : anonymous_id
75+ DocumentType . where ( user_id : id ) . update_all user_id : anonymous_id
6976 end
7077
7178 def after_database_authentication
You can’t perform that action at this time.
0 commit comments