aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/categorization.rb
diff options
context:
space:
mode:
authorSzymon Nowak <szimek@gmail.com>2009-08-13 21:18:43 +0200
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-23 15:19:17 -0800
commit85683f2a79dbf81130361cb6426786cf6b0d1925 (patch)
treec802a675983c3a7cb9d3a31ae8adf63d1baca0ca /activerecord/test/models/categorization.rb
parentb79823832e6cd30a9f14f97ffdf1642d4d63d4ea (diff)
downloadrails-85683f2a79dbf81130361cb6426786cf6b0d1925.tar.gz
rails-85683f2a79dbf81130361cb6426786cf6b0d1925.tar.bz2
rails-85683f2a79dbf81130361cb6426786cf6b0d1925.zip
Fix creation of has_many through records with custom primary_key option on belongs_to [#2990 state:resolved]
Diffstat (limited to 'activerecord/test/models/categorization.rb')
-rw-r--r--activerecord/test/models/categorization.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/categorization.rb b/activerecord/test/models/categorization.rb
index fdb0a11540..45f50e4af3 100644
--- a/activerecord/test/models/categorization.rb
+++ b/activerecord/test/models/categorization.rb
@@ -1,6 +1,7 @@
class Categorization < ActiveRecord::Base
belongs_to :post
belongs_to :category
+ belongs_to :named_category, :class_name => 'Category', :foreign_key => :named_category_name, :primary_key => :name
belongs_to :author
belongs_to :author_using_custom_pk, :class_name => 'Author', :foreign_key => :author_id, :primary_key => :author_address_extra_id