clarion/db/migrate/20150530182857_populate_conference_id_in_personal_profiles.rb
Andrew Radev 454f18dd2f A user has many profiles now
Still need to change controllers quite a lot.
2015-05-30 18:53:14 +03:00

13 lines
307 B
Ruby

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