aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
diff options
context:
space:
mode:
authorMarian Rudzynski <mr@impaled.org>2011-05-26 11:00:27 +0200
committerMarian Rudzynski <mr@impaled.org>2011-05-26 11:00:27 +0200
commit1f7c3d02645c6b72e5d1428bc7da6668cdee5fa8 (patch)
treeb18e2f51ba10bc66caac831b4b8d10270cf9a761 /activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
parentbadc72f3e645b4176b04a4f5181a7f8a04a32f09 (diff)
downloadrails-1f7c3d02645c6b72e5d1428bc7da6668cdee5fa8.tar.gz
rails-1f7c3d02645c6b72e5d1428bc7da6668cdee5fa8.tar.bz2
rails-1f7c3d02645c6b72e5d1428bc7da6668cdee5fa8.zip
use association_primary_key in AssociationScope#add_constraints
Diffstat (limited to 'activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
index f4d14853d3..b8442656ee 100644
--- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
@@ -100,6 +100,13 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
assert_equal 'c1', record[0]
assert_equal 't1', record[1]
end
+
+ def test_proper_usage_of_primary_keys_and_join_table
+ setup_data_for_habtm_case
+
+ country = Country.first
+ assert_equal 1, country.treaties.count
+ end
def test_has_and_belongs_to_many
david = Developer.find(1)