search for: fk_sections

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

Did you mean: cfi_sections
2006 Feb 27
1
How to build a recursive parenting structure?
...d "sections_sections" to build the heirarchy however the fields I generated were: CREATE TABLE `sections_sections` ( `section_id` INT( 10 ) UNSIGNED NOT NULL, `parent_id` INT( 10 ) UNSIGNED NOT NULL , constraint fk_parents foreign key (parent_id) references sections(id), constraint fk_sections foreign key (section_id) references sections(id) ); Because I can''t have two section_id fields. So how can I let rails know that it should look for parent_id when I do something like: @section.sections.include?(@section_to_look_for)? -- Posted via http://www.ruby-forum.com/.