-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Replicate providers, topics, tags from manifest using external IDs
ContentProviderSync:
class ContentProviderSync
def sync(provider_data)
ContentProvider.find_or_initialize_by(external_id: provider_data["id"]).tap do |p|
p.update!(name: provider_data["name"])
end
end
endTopicSync:
class TopicSync
def sync(topic_data, content_provider)
Topic.find_or_initialize_by(external_id: topic_data["id"]).tap do |t|
t.update!(
content_provider: content_provider,
title: topic_data["name"],
# map other fields...
)
sync_tags(t, topic_data["tag_ids"])
end
end
endTagSync:
class TagSync
def sync(tag_data)
Tag.find_or_initialize_by(external_id: tag_data["id"]).tap do |t|
t.update!(name: tag_data["name"])
end
end
endReactions are currently unavailable