UX: warn about messages to be orphaned while deleting a group. (#11727)

Currently, after destroying a group its messages are inaccessible to everyone. Only admins can access using direct URLs.
This commit is contained in:
Vinoth Kannan
2021-01-22 03:29:34 +05:30
committed by GitHub
parent 5cbb522c41
commit 872f3e6934
7 changed files with 37 additions and 4 deletions
+5
View File
@@ -838,6 +838,11 @@ class Group < ActiveRecord::Base
)
end
def message_count
return 0 unless self.has_messages
TopicAllowedGroup.where(group_id: self.id).joins(:topic).count
end
protected
def name_format_validator