is_leader
Rails アプリケーションでは、関連付けテーブルの名前を付けた新しい列を追加する必要がありました。
関連テーブルの関係は次のとおりです。
has_and_belongs_to_many :analysis_responses, :join_table => "analysis_responses_participants"
以下は、参加者の詳細がデータベースに保存されたコードです。
organization.people.create(participant)
はparticipant
次の値を持っています
name: Test User
position:
birthdate:
id:
lead: "1"
先頭の値が 1 の場合、is_leader
列の値は1
特定のレコードのものである必要があります。
is_leader
その関連テーブルの値をレールに保存する方法を知りたかった
ありがとう