collab/app/models/project.rb

12 lines
348 B
Ruby
Raw Normal View History

2010-03-04 06:22:45 +00:00
class Project < ActiveRecord::Base
has_many :tasks
2010-03-05 06:48:00 +00:00
belongs_to :owner, :class_name => "User", :foreign_key => "owner_id"
2010-03-04 06:22:45 +00:00
validates_presence_of :name
2010-03-05 06:48:00 +00:00
has_and_belongs_to_many :users
validates_uniqueness_of :name
named_scope :archived, :conditions => {:archived => true}
named_scope :active, :conditions => {:archived => false}
2010-03-04 06:22:45 +00:00
end