aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/author.rb
diff options
context:
space:
mode:
authorSzymon Nowak <szimek@gmail.com>2009-07-15 22:22:25 +0200
committerJeremy Kemper <jeremy@bitsweat.net>2009-07-15 18:13:32 -0700
commit1c11437a32a973fa9b521c32caa7256f9772acd7 (patch)
treee2a38c67d3ab84c5abdb80756ed69befa36ff574 /activerecord/test/models/author.rb
parent0920e69244026ec83471bb4571e56300045307d3 (diff)
downloadrails-1c11437a32a973fa9b521c32caa7256f9772acd7.tar.gz
rails-1c11437a32a973fa9b521c32caa7256f9772acd7.tar.bz2
rails-1c11437a32a973fa9b521c32caa7256f9772acd7.zip
Add primary_key option to belongs_to association
[#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test/models/author.rb')
-rw-r--r--activerecord/test/models/author.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb
index 0d9ee36b20..b844c7cce0 100644
--- a/activerecord/test/models/author.rb
+++ b/activerecord/test/models/author.rb
@@ -87,6 +87,8 @@ class Author < ActiveRecord::Base
has_many :tags, :through => :posts # through has_many :through
has_many :post_categories, :through => :posts, :source => :categories
+ has_one :essay, :primary_key => :name, :as => :writer
+
belongs_to :author_address, :dependent => :destroy
belongs_to :author_address_extra, :dependent => :delete, :class_name => "AuthorAddress"