diff options
author | Szymon Nowak <szimek@gmail.com> | 2009-08-13 21:18:43 +0200 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-23 15:19:17 -0800 |
commit | 85683f2a79dbf81130361cb6426786cf6b0d1925 (patch) | |
tree | c802a675983c3a7cb9d3a31ae8adf63d1baca0ca /activerecord/test/models | |
parent | b79823832e6cd30a9f14f97ffdf1642d4d63d4ea (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/test/models/author.rb | 1 | ||||
-rw-r--r-- | activerecord/test/models/categorization.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 244c5ac4f5..83a6f5d926 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -78,6 +78,7 @@ class Author < ActiveRecord::Base has_many :categorizations has_many :categories, :through => :categorizations + has_many :named_categories, :through => :categorizations has_many :special_categorizations has_many :special_categories, :through => :special_categorizations, :source => :category 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 |