discourse/lib/import_export/group_exporter.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
513 B
Ruby
Raw Permalink Normal View History

# 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