class Task < ActiveRecord::Base belongs_to :person belongs_to :user validates_presence_of :title, :message => 'Please supply a title' validates_associated :person, :message => 'The specified person is invalid' validates_associated :user, :message => 'The specified owner is invalid' validates_presence_of :start, :message => 'Please set a start date and time for the task' has_many :file_attachments, :dependent => :destroy, :order => 'filename' end