Override ActiveRecord << operator on has_many :through relationship, to accept data for the join model
问题 I have three classes: Person, Position, and Directory. A Person has_many :directories, :through => :position. A Directory has_many :people, :through => :position. Both Person and Directory has_many :positions. The Position model, in addition to having an id, a person_id, and a directory_id, has one or more additional fields (e.g., title). What I would like to be able to do is add data to the join model, such as the title field, every time I add a person to a Directory.people collection. The