Call update_all on a relation, not 'update' which exists on a model

pull/1/head
Liam Morley 4 years ago
parent 8804f11e49
commit 2d4ba042f9

@ -4,8 +4,8 @@ namespace :one_off do
combined_school.update qualtrics_code: 5
full_circle = School.find_by_name 'Full Circle High School'
next_wave = School.find_by_name 'Next Wave Junior High School'
SurveyItemResponse.where(school: [full_circle, next_wave]).update! school: combined_school
full_circle.destroy
next_wave.destroy
SurveyItemResponse.where(school: [full_circle, next_wave]).update_all school_id: combined_school.id
full_circle.destroy!
next_wave.destroy!
end
end

Loading…
Cancel
Save