本質上講,我們有兩種模式,一個加入表 class Guests < ActiveRecord::Base
has_and_belongs_to_many :events
end
class Event < ActiveRecord::Base
has_and_belongs_to_many :guests
end
class CreateJoinTableGuest
我有這個遷移在我的Rails項目 class ChangeColumnDefaultOfTemp < ActiveRecord::Migration
def up
change_column_null :states, :temp, false, ''
change_column_default :states, :temp, ''
end
de