Skip to content

Commit

Permalink
Add safe navigation to data migration
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Jan 17, 2025
1 parent 0bd2840 commit 8d63b2a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/update_ratifying_provider_for_course.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# frozen_string_literal: true

class UpdateRatifyingProviderForCourse
# PROVIDERS = %w[5W1 1BJ 24H 4R4 2a5].freeze
# TARGET_PROVIDER = '3A1'

def initialize(training_provider_code:, target_ratifying_provider_code:)
@training_provider = RecruitmentCycle.current.providers.find_by(provider_code: training_provider_code)
@target_ratifying_provider_code = target_ratifying_provider_code
end

def call
@training_provider.courses.each do |course|
@training_provider&.courses&.each do |course|
course.update!(accredited_provider_code: @target_ratifying_provider_code)
end
end
Expand Down

0 comments on commit 8d63b2a

Please sign in to comment.