diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-12-28 20:00:29 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-28 20:00:29 +0000 |
commit | d6c2285e31cbc7150cf99ff3a537eddbdb50fb29 (patch) | |
tree | 785f0c7ad566a09b9bc558854b4a5d43ae86ed46 /activerecord/test/models/person.rb | |
parent | aaea12c497ca86a86fbda8409c226630ade22f89 (diff) | |
parent | a2270ef2594b97891994848138614657363f2806 (diff) | |
download | rails-d6c2285e31cbc7150cf99ff3a537eddbdb50fb29.tar.gz rails-d6c2285e31cbc7150cf99ff3a537eddbdb50fb29.tar.bz2 rails-d6c2285e31cbc7150cf99ff3a537eddbdb50fb29.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'activerecord/test/models/person.rb')
-rw-r--r-- | activerecord/test/models/person.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/person.rb b/activerecord/test/models/person.rb index 430d0b38f7..ec2f684a6e 100644 --- a/activerecord/test/models/person.rb +++ b/activerecord/test/models/person.rb @@ -7,4 +7,10 @@ class Person < ActiveRecord::Base has_many :jobs, :through => :references has_one :favourite_reference, :class_name => 'Reference', :conditions => ['favourite=?', true] has_many :posts_with_comments_sorted_by_comment_id, :through => :readers, :source => :post, :include => :comments, :order => 'comments.id' + + belongs_to :primary_contact, :class_name => 'Person' + has_many :agents, :class_name => 'Person', :foreign_key => 'primary_contact_id' + + named_scope :males, :conditions => { :gender => 'M' } + named_scope :females, :conditions => { :gender => 'F' } end |