Displaying 1 result from an estimated 1 matches for "parents_task".
2006 Mar 21
3
Newbie - ActiveRecord relationships
...d_belongs_to_many :tasks
has_many :logs
has_many :users, :through => :logs
...
class Task < ActiveRecord::Base
belongs_to :client
belongs_to :user
has_and_belongs_to_many :users
has_and_belongs_to_many :parents,
:class_name => "Task",
:join_table => "parents_task",
:association_foreign_key => "parent_id",
:foreign_key => "task_id"
has_many :logs
has_many :users, :through => :logs
...
My db schema is below. If anyone has some pointers for me I''d REALLY
appreciate it.
Thanks
Nick
CREATE TABLE `tasks` (...