mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 08:06:08 +08:00
29 lines
529 B
Ruby
29 lines
529 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
|