Skip to content

Instantly share code, notes, and snippets.

@Keqi
Created April 24, 2023 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keqi/a02efd30040b8eaebe3ba00f3b4d49c8 to your computer and use it in GitHub Desktop.
Save Keqi/a02efd30040b8eaebe3ba00f3b4d49c8 to your computer and use it in GitHub Desktop.
airtable_cohorts = Airtable::ProgramStructureApi.new.cohorts
ProgramCohort.find_each do |pc|
r = airtable_cohorts.find { |record| record.fields['Cohort Name'] == pc.name }
next unless r
pc.update(external_id: r.id) if pc.external_id != r.id
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment