aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/author.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-10-19 16:13:06 +0100
committerJon Leighton <j@jonathanleighton.com>2010-10-19 16:13:06 +0100
commit915ea5ea826d48107e4c1953c7a32cf26727d10e (patch)
tree6d9c1284df9ac076d2b083737374f6b884f7197b /activerecord/test/models/author.rb
parent0ceb34295501a797c9e549c581ecee17f837f01c (diff)
downloadrails-915ea5ea826d48107e4c1953c7a32cf26727d10e.tar.gz
rails-915ea5ea826d48107e4c1953c7a32cf26727d10e.tar.bz2
rails-915ea5ea826d48107e4c1953c7a32cf26727d10e.zip
Support the :primary_key option on a through reflection in a nested through association
Diffstat (limited to 'activerecord/test/models/author.rb')
-rw-r--r--activerecord/test/models/author.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb
index 53b3b80950..dd8a20ce9b 100644
--- a/activerecord/test/models/author.rb
+++ b/activerecord/test/models/author.rb
@@ -110,6 +110,9 @@ class Author < ActiveRecord::Base
has_many :essays_2, :primary_key => :name, :class_name => 'Essay', :foreign_key => :author_id
has_many :essay_categories_2, :through => :essays_2, :source => :category
+ belongs_to :owned_essay, :primary_key => :name, :class_name => 'Essay'
+ has_one :owned_essay_category, :through => :owned_essay, :source => :category
+
belongs_to :author_address, :dependent => :destroy
belongs_to :author_address_extra, :dependent => :delete, :class_name => "AuthorAddress"