mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 14:24:27 +08:00
25 lines
513 B
Ruby
25 lines
513 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ImportExport
|
|
class GroupExporter < BaseExporter
|
|
def initialize(include_group_users = false)
|
|
@include_group_users = include_group_users
|
|
|
|
@export_data = { groups: [] }
|
|
@export_data[:users] = [] if @include_group_users
|
|
end
|
|
|
|
def perform
|
|
puts "Exporting all user groups...", ""
|
|
export_groups!
|
|
export_group_users! if @include_group_users
|
|
|
|
self
|
|
end
|
|
|
|
def default_filename_prefix
|
|
"groups-export"
|
|
end
|
|
end
|
|
end
|