From e665cc83cc6993abb8cb75a25127346b9fa68440 Mon Sep 17 00:00:00 2001 From: Mohamed El-Sawy Date: Wed, 21 Aug 2024 14:52:30 +0300 Subject: [PATCH] CV2-5051: disable version for FactCheck when update report (#2000) --- config/initializers/report_designer.rb | 30 +++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/config/initializers/report_designer.rb b/config/initializers/report_designer.rb index 08cd3dcbf8..ffbf4d7d2b 100644 --- a/config/initializers/report_designer.rb +++ b/config/initializers/report_designer.rb @@ -50,9 +50,11 @@ if fc.nil? FactCheck.create({ claim_description: pm.claim_description }.merge(fields)) else - fields.each { |field, value| fc.send("#{field}=", value) } - fc.skip_check_ability = true - fc.save! + PaperTrail.request(enabled: false) do + fields.each { |field, value| fc.send("#{field}=", value) } + fc.skip_check_ability = true + fc.save! + end end end @@ -66,16 +68,18 @@ # Update report fields fc = pm&.claim_description&.fact_check unless fc.nil? - state = self.data['state'] - fields = { - skip_report_update: true, - publisher_id: nil, - report_status: state, - rating: pm.status - } - fields.each { |field, value| fc.send("#{field}=", value) } - fc.skip_check_ability = true - fc.save! + PaperTrail.request(enabled: false) do + state = self.data['state'] + fields = { + skip_report_update: true, + publisher_id: nil, + report_status: state, + rating: pm.status + } + fields.each { |field, value| fc.send("#{field}=", value) } + fc.skip_check_ability = true + fc.save! + end end end end