diff options
Diffstat (limited to 'lib/bulk_imports/groups/pipelines/group_attributes_pipeline.rb')
-rw-r--r-- | lib/bulk_imports/groups/pipelines/group_attributes_pipeline.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/bulk_imports/groups/pipelines/group_attributes_pipeline.rb b/lib/bulk_imports/groups/pipelines/group_attributes_pipeline.rb new file mode 100644 index 00000000000..d4f5901e971 --- /dev/null +++ b/lib/bulk_imports/groups/pipelines/group_attributes_pipeline.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module BulkImports + module Groups + module Pipelines + class GroupAttributesPipeline + include Pipeline + + file_extraction_pipeline! + + relation_name BulkImports::FileTransfer::BaseConfig::SELF_RELATION + + extractor ::BulkImports::Common::Extractors::JsonExtractor, relation: relation + + transformer ::BulkImports::Common::Transformers::ProhibitedAttributesTransformer + + def transform(_context, data) + return unless data + + data.symbolize_keys.slice(:membership_lock) + end + + def load(_context, data) + return unless data + + ::Groups::UpdateService.new(portable, current_user, data).execute + end + + def after_run(_context) + extractor.remove_tmpdir + end + end + end + end +end |