diff --git a/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb b/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb index ff151ea..fdbd02d 100644 --- a/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb +++ b/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb @@ -6,7 +6,10 @@ end class PopulateConferenceIdInPersonalProfiles < ActiveRecord::Migration def change - conference = Conference.first! - PersonalProfile.where(conference_id: nil).update_all(conference_id: conference.id) + conference = Conference.first + + if conference + PersonalProfile.where(conference_id: nil).update_all(conference_id: conference.id) + end end end