fix(champ): do not reset data on champs without fetch_external_data

This commit is contained in:
Paul Chavard 2024-02-20 17:49:07 +01:00
parent 6ef969a7d9
commit 702b9dd8b3
8 changed files with 589 additions and 142 deletions

View file

@ -282,7 +282,7 @@ class Champ < ApplicationRecord
end
def cleanup_if_empty
if persisted? && external_id_changed?
if fetch_external_data? && persisted? && external_id_changed?
self.data = nil
end
end