2010-03-04 06:22:45 +00:00
|
|
|
class Task < ActiveRecord::Base
|
|
|
|
belongs_to :project
|
|
|
|
has_many :tasks, :foreign_key => :parent
|
|
|
|
|
2010-03-04 22:42:09 +00:00
|
|
|
named_scope :parents, :conditions => {:parent => nil}
|
|
|
|
|
2010-03-04 06:22:45 +00:00
|
|
|
validates_presence_of :name, :description, :project_id
|
|
|
|
validates_associated :project
|
|
|
|
end
|