@@ -666,23 +666,27 class User < Principal | |||||
666 | return if self.id.nil? |
|
666 | return if self.id.nil? | |
667 |
|
667 | |||
668 | substitute = User.anonymous |
|
668 | substitute = User.anonymous | |
669 |
Attachment.update_all |
|
669 | Attachment.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id]) | |
670 |
Comment.update_all |
|
670 | Comment.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id]) | |
671 |
Issue.update_all |
|
671 | Issue.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id]) | |
672 | Issue.update_all 'assigned_to_id = NULL', ['assigned_to_id = ?', id] |
|
672 | Issue.where(['assigned_to_id = ?', id]).update_all('assigned_to_id = NULL') | |
673 |
Journal.update_all |
|
673 | Journal.where(['user_id = ?', id]).update_all(['user_id = ?', substitute.id]) | |
674 | JournalDetail.update_all ['old_value = ?', substitute.id.to_s], ["property = 'attr' AND prop_key = 'assigned_to_id' AND old_value = ?", id.to_s] |
|
674 | JournalDetail. | |
675 |
|
|
675 | where(["property = 'attr' AND prop_key = 'assigned_to_id' AND old_value = ?", id.to_s]). | |
676 | Message.update_all ['author_id = ?', substitute.id], ['author_id = ?', id] |
|
676 | update_all(['old_value = ?', substitute.id.to_s]) | |
677 | News.update_all ['author_id = ?', substitute.id], ['author_id = ?', id] |
|
677 | JournalDetail. | |
|
678 | where(["property = 'attr' AND prop_key = 'assigned_to_id' AND value = ?", id.to_s]). | |||
|
679 | update_all(['value = ?', substitute.id.to_s]) | |||
|
680 | Message.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id]) | |||
|
681 | News.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id]) | |||
678 | # Remove private queries and keep public ones |
|
682 | # Remove private queries and keep public ones | |
679 | ::Query.delete_all ['user_id = ? AND visibility = ?', id, ::Query::VISIBILITY_PRIVATE] |
|
683 | ::Query.delete_all ['user_id = ? AND visibility = ?', id, ::Query::VISIBILITY_PRIVATE] | |
680 | ::Query.update_all ['user_id = ?', substitute.id], ['user_id = ?', id] |
|
684 | ::Query.update_all ['user_id = ?', substitute.id], ['user_id = ?', id] | |
681 |
TimeEntry.update_all |
|
685 | TimeEntry.where(['user_id = ?', id]).update_all(['user_id = ?', substitute.id]) | |
682 | Token.delete_all ['user_id = ?', id] |
|
686 | Token.delete_all ['user_id = ?', id] | |
683 | Watcher.delete_all ['user_id = ?', id] |
|
687 | Watcher.delete_all ['user_id = ?', id] | |
684 |
WikiContent.update_all |
|
688 | WikiContent.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id]) | |
685 |
WikiContent::Version.update_all |
|
689 | WikiContent::Version.where(['author_id = ?', id]).update_all(['author_id = ?', substitute.id]) | |
686 | end |
|
690 | end | |
687 |
|
691 | |||
688 | # Return password digest |
|
692 | # Return password digest |
General Comments 0
You need to be logged in to leave comments.
Login now