demarches-normaliennes/app/jobs/champ_fetch_external_data_job.rb

12 lines
229 B
Ruby
Raw Normal View History

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