search for: category1_id

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

Did you mean: category&id
2006 Mar 17
0
Multiple Associations, Multiple Joins
Two separate questions in this post. 1. I have a model with two foreign keys to the same table. In this case, the associations represent "categories", so I have category1_id and category2_id. Doing belongs_to :category, :foreign_key => "category1_id" works, and I can use foo.category, however when I want to access the second category, I am forced to use SQL. I realize that with a many-many relationship like this, a bridging table might have been appro...