FEATURE: Extend PM recipient bulk imports (#27063)

* FIX: Support multiple topic allowed user imports

* FEATURE: Add topic allowed groups import support
This commit is contained in:
Selase Krakani
2024-05-17 13:45:20 +02:00
committed by GitHub
parent f5a0da6eba
commit 61e12aaebe
2 changed files with 62 additions and 15 deletions

View File

@ -636,6 +636,8 @@ class BulkImport::Base
TOPIC_ALLOWED_USER_COLUMNS ||= %i[topic_id user_id created_at updated_at]
TOPIC_ALLOWED_GROUP_COLUMNS ||= %i[topic_id group_id created_at updated_at]
TOPIC_TAG_COLUMNS ||= %i[topic_id tag_id created_at updated_at]
TOPIC_USER_COLUMNS ||= %i[
@ -879,6 +881,10 @@ class BulkImport::Base
create_records(rows, "topic_allowed_user", TOPIC_ALLOWED_USER_COLUMNS, &block)
end
def create_topic_allowed_groups(rows, &block)
create_records(rows, "topic_allowed_group", TOPIC_ALLOWED_GROUP_COLUMNS, &block)
end
def create_topic_tags(rows, &block)
create_records(rows, "topic_tag", TOPIC_TAG_COLUMNS, &block)
end
@ -1307,6 +1313,12 @@ class BulkImport::Base
topic_allowed_user
end
def process_topic_allowed_group(topic_allowed_group)
topic_allowed_group[:created_at] = NOW
topic_allowed_group[:updated_at] = NOW
topic_allowed_group
end
def process_topic_tag(topic_tag)
topic_tag[:created_at] = NOW
topic_tag[:updated_at] = NOW