search for: primary_picture_id

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

2006 Apr 02
7
RANT: belongs_to -> refers_to
...cord feature, and half of which were probably just making the same mistake I was. I started getting nil objects, and was mystified until I finally tried explicitly setting the foreign key: :has_one primary_picture, :class_name => ''Picture'', :foreign_key => ''primary_picture_id'' at which point Rails helpfully told me that there was no Picture.primary_picture_id field. Then I remembered for the umpteenth time that has_one is for the record that does NOT have the foreign key, and belongs_to is for the one that does, and I should not be misled by the semantics of...