demarches-normaliennes/app/jobs/champ_fetch_external_data_job.rb

12 lines
267 B
Ruby
Raw Normal View History

2021-02-09 12:35:23 +01:00
class ChampFetchExternalDataJob < ApplicationJob
def perform(champ, external_id)
if champ.external_id == external_id && champ.data.nil?
2021-02-09 12:35:23 +01:00
data = champ.fetch_external_data
if data.present?
champ.update!(data: data)
end
end
end
end