From 107d15492eececd54dfed82790ec082383df1644 Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:41:30 -0300 Subject: [PATCH] Adding more fields to the data export --- lib/tasks/data/text_similarity_data.rake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/tasks/data/text_similarity_data.rake b/lib/tasks/data/text_similarity_data.rake index 1d799bb97..c16d634ad 100644 --- a/lib/tasks/data/text_similarity_data.rake +++ b/lib/tasks/data/text_similarity_data.rake @@ -20,8 +20,12 @@ namespace :check do 'explainer' => :description, 'fact-check' => :summary } + claim = nil + claim = article.claim_description.description if type == 'fact-check' { id: nil, + team_id: nil, + team_slug: nil, media_id: nil, title: nil, description: nil, @@ -33,7 +37,8 @@ namespace :check do title: article.title, body: article.send(body_method_mapping[type]), url: article.url, - type: type + type: type, + claim: claim }] } end @@ -75,6 +80,8 @@ namespace :check do # Item data object = { id: item.id, + team_id: item.team_id, + team_slug: item.team.slug, media_id: item.media_id, title: item.title, description: item.description, @@ -90,6 +97,7 @@ namespace :check do title: explainer.title, body: explainer.description, url: explainer.url, + claim: nil, type: 'explainer' } end @@ -102,6 +110,7 @@ namespace :check do title: fact_check.title, body: fact_check.summary, url: fact_check.url, + claim: fact_check.claim_description.description, type: 'fact-check' } end @@ -113,7 +122,7 @@ namespace :check do parent_id: relationship.source_id, child_id: relationship.target_id, user_name: relationship.user&.name - } + }.merge(relationship.as_json) end data << object