Displaying 3 results from an estimated 3 matches for "supervisor_id".
2006 May 30
0
Single table lookups
I''m struggling with a single table type (self) lookup.
my ''personnel'' model has a supervisor_id and is_supervisor column.
The supervisor''s select list is created by
@supv = Personnel.find(:all,
:conditions => ["is_supervisor = true"],
:order => ''last_name'')
in my personnel model, I have the following...
def supervisor
if Personnel.fi...
2006 Apr 09
1
Join using :THROUGH - SQL is wrong even when using :SOURCE
Here''s a join table for an educational institution:
create_table "student_appointments", :force => true do |t|
t.column "supervisor_id", :integer, :default => 0, :null => false
t.column "student_id", :integer, :default => 0, :null => false
t.column "course_id", :integer, :default => 0, :null => false
[other columns omitted for clarity]
end
It is meant to be created when a student i...
2005 Jul 21
1
Self-Referencing Tables and Other DB Complexities
How well does Rails deal with ActiveRecord classes mapping to
self-referencing tables and other more interesting database
complexities?
i.e. Employees table with supervisor_id and mentor_id both
self-referencing Employees on the primary key "id"
or Categories table with relation table (Parent_Child_Categories) with
foreign keys parent_id and child_id both referencing Categories.id
allowing for infinite nesting of many-many related categories
or Supervisors ta...