mirror of
https://github.com/discourse/discourse.git
synced 2026-08-13 06:25:11 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user