Skip to content

Commit

Permalink
Remove .all from ConsentForm find_each migrations
Browse files Browse the repository at this point in the history
It shouldn't be necessary.
  • Loading branch information
tvararu committed Oct 16, 2024
1 parent 2b29f0c commit 48a71a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class AddProgrammeToConsentForms < ActiveRecord::Migration[7.2]
def up
add_reference :consent_forms, :programme, foreign_key: true

ConsentForm.all.find_each do |consent_form|
ConsentForm.find_each do |consent_form|
consent_form.update!(
programme_id: (consent_form.session.programme || Programme.first).id
)
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20241002125816_add_team_to_consent_forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class AddTeamToConsentForms < ActiveRecord::Migration[7.2]
def up
add_reference :consent_forms, :team, foreign_key: true

ConsentForm.all.find_each do |consent_form|
ConsentForm.find_each do |consent_form|
consent_form.update!(team_id: consent_form.session.team_id)
end

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20241002130716_add_school_to_consent_forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class AddSchoolToConsentForms < ActiveRecord::Migration[7.2]
def up
add_reference :consent_forms, :school, foreign_key: { to_table: :locations }

ConsentForm.all.find_each do |consent_form|
ConsentForm.find_each do |consent_form|
consent_form.update!(location_id: consent_form.session.team_id)
end

Expand Down

0 comments on commit 48a71a0

Please sign in to comment.