From a7f77b042e155def81bf7043514c2c400e441e37 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sun, 7 Dec 2025 23:58:05 +0100 Subject: [PATCH] Set raw_data to an empty hash instead of nil when archiving --- app/services/points/raw_data/archiver.rb | 2 +- spec/services/points/raw_data/archiver_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/points/raw_data/archiver.rb b/app/services/points/raw_data/archiver.rb index 717275bf..6109091e 100644 --- a/app/services/points/raw_data/archiver.rb +++ b/app/services/points/raw_data/archiver.rb @@ -121,7 +121,7 @@ module Points Point.where(id: point_ids).update_all( raw_data_archived: true, raw_data_archive_id: archive_id, - raw_data: nil + raw_data: {} ) end end diff --git a/spec/services/points/raw_data/archiver_spec.rb b/spec/services/points/raw_data/archiver_spec.rb index ae350f06..a25f92ef 100644 --- a/spec/services/points/raw_data/archiver_spec.rb +++ b/spec/services/points/raw_data/archiver_spec.rb @@ -51,7 +51,7 @@ RSpec.describe Points::RawData::Archiver do it 'nullifies raw_data column' do archiver.call Point.where(user: user).find_each do |point| - expect(point.raw_data).to be_nil + expect(point.raw_data).to eq({}) end end