search for: participated_incident_id

Displaying 1 result from an estimated 1 matches for "participated_incident_id".

2013 Feb 08
1
Problem with many to many relationship
...n has_many :incident_participants, foreign_key: "participant_id" has_many :participated_incidents, through: :incident_participants end class Incident < ActiveRecord::Base include ActiveModel::ForbiddenAttributesProtection has_many :incident_participants, foreign_key: "participated_incident_id" has_many :participants, through: :incident_participants end The join table: class IncidentParticipant < ActiveRecord::Base include ActiveModel::ForbiddenAttributesProtection t.belongs_to :participant, class_name: "User" t.belongs_to :participated_incident, class_name...