Skip to content

Commit fb20637

Browse files
committed
Add a Rake task to sync existing schools to SF
While the code in this branch will update sales force on create or update, there is some work required to back-fill existing data into Salesforce. This commit provides a Rake task, patterened after that in `clubs-api` that will do this. Inspired by: https://github.com/RaspberryPiFoundation/clubs-api/blob/main/lib/tasks/salesforce_sync.rake
1 parent 31210b4 commit fb20637

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/tasks/salesforce_sync.rake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
namespace :salesforce_sync do
4+
desc 'Sync all Schools to Salesforce'
5+
task school: :environment do
6+
School.pluck(:id).each do |school_id|
7+
Salesforce::SchoolSyncJob.perform_later(school_id:)
8+
end
9+
end
10+
end

0 commit comments

Comments
 (0)