2019-04-28 11:56:16 +03:00
|
|
|
class CreateEventsToSpeakersJoinTable < ActiveRecord::Migration[4.2]
|
2014-10-13 16:50:16 +03:00
|
|
|
def up
|
|
|
|
create_join_table :events, :speaker_profiles
|
|
|
|
Event.all.each do |event|
|
|
|
|
event.speakers << event.user.speaker_profile if event.user.speaker_profile.present?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
drop_table :events_speaker_profiles
|
|
|
|
end
|
|
|
|
end
|