From 1c11437a32a973fa9b521c32caa7256f9772acd7 Mon Sep 17 00:00:00 2001 From: Szymon Nowak Date: Wed, 15 Jul 2009 22:22:25 +0200 Subject: Add primary_key option to belongs_to association [#765 state:committed] Signed-off-by: Jeremy Kemper --- activerecord/test/models/topic.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/test/models/topic.rb') diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb index 51012d22ed..201d96dcd7 100644 --- a/activerecord/test/models/topic.rb +++ b/activerecord/test/models/topic.rb @@ -39,6 +39,7 @@ class Topic < ActiveRecord::Base named_scope :by_rejected_ids, lambda {{ :conditions => { :id => all(:conditions => {:approved => false}).map(&:id) } }} has_many :replies, :dependent => :destroy, :foreign_key => "parent_id" + has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title" serialize :content before_create :default_written_on -- cgit v1.2.3