1 class Person
< ActiveRecord
::Base
3 has_many
:posts, :through => :readers
4 has_many
:posts_with_no_comments, :through => :readers, :source => :post, :include => :comments, :conditions => 'comments.id is null'
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'
11 belongs_to
:primary_contact, :class_name => 'Person'
12 has_many
:agents, :class_name => 'Person', :foreign_key => 'primary_contact_id'
14 named_scope
:males, :conditions => { :gender => 'M' }
15 named_scope
:females, :conditions => { :gender => 'F' }