clarion/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb
2015-07-12 11:22:19 +03:00

16 lines
335 B
Ruby

class Conference < ActiveRecord::Base
end
class PersonalProfile < ActiveRecord::Base
end
class PopulateConferenceIdInPersonalProfiles < ActiveRecord::Migration
def change
conference = Conference.first
if conference
PersonalProfile.where(conference_id: nil).update_all(conference_id: conference.id)
end
end
end