clarion/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb

16 lines
335 B
Ruby
Raw Normal View History

class Conference < ActiveRecord::Base
end
class PersonalProfile < ActiveRecord::Base
end
class PopulateConferenceIdInPersonalProfiles < ActiveRecord::Migration
def change
2015-07-12 11:22:19 +03:00
conference = Conference.first
if conference
PersonalProfile.where(conference_id: nil).update_all(conference_id: conference.id)
end
end
end