Updated README.rdoc again
[feedcatcher.git] / vendor / rails / activerecord / test / models / person.rb
1 class Person < ActiveRecord::Base
2 has_many :readers
3 has_many :posts, :through => :readers
4 has_many :posts_with_no_comments, :through => :readers, :source => :post, :include => :comments, :conditions => 'comments.id is null'
5
6 has_many :references
7 has_many :jobs, :through => :references
8 has_one :favourite_reference, :class_name => 'Reference', :conditions => ['favourite=?', true]
9 has_many :posts_with_comments_sorted_by_comment_id, :through => :readers, :source => :post, :include => :comments, :order => 'comments.id'
10
11 belongs_to :primary_contact, :class_name => 'Person'
12 has_many :agents, :class_name => 'Person', :foreign_key => 'primary_contact_id'
13
14 named_scope :males, :conditions => { :gender => 'M' }
15 named_scope :females, :conditions => { :gender => 'F' }
16 end