関連付け用の結合テーブルの移行を生成するための多くSO
の投稿を調べましたが、何も機能しません。google
has many and belongs to many
すべてのソリューションが空の移行ファイルを生成しています。
私が使用rails 3.2.13
していて、2 つのテーブルがあります:security_users
とassignments
. これらは私が試したことのいくつかです:
rails generate migration assignments_security_users
rails generate migration create_assignments_security_users
rails generate migration create_assignments_security_users_join_table
rails g migration create_join_table :products, :categories (following the official documentation)
rails generate migration security_users_assignments security_user:belongs_to assignments:belongs_to
2 つのテーブル間で結合テーブルの移行を作成する方法を誰か教えてもらえますか?