Fix migration that fails in build

This commit is contained in:
Andrew Radev 2015-07-12 11:22:19 +03:00
parent df682e65e5
commit 08bbd1ffa1
1 changed files with 5 additions and 2 deletions

View File

@ -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