diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-26 16:10:57 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-26 16:16:57 -0700 |
commit | d1c74706c35b0b17b22c4b2541353d1b9ac6bfa5 (patch) | |
tree | 5c03650371de1cee073a14543db5275599961521 /activerecord | |
parent | 602fff1f58dff5cfdf861b48626b32f99fe27246 (diff) | |
download | rails-d1c74706c35b0b17b22c4b2541353d1b9ac6bfa5.tar.gz rails-d1c74706c35b0b17b22c4b2541353d1b9ac6bfa5.tar.bz2 rails-d1c74706c35b0b17b22c4b2541353d1b9ac6bfa5.zip |
adding a test for #1322
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 5028cee32d..be92b30131 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -380,6 +380,21 @@ class EagerAssociationTest < ActiveRecord::TestCase assert_equal subscriptions, subscriber.subscriptions.sort_by(&:id) end + def test_string_id_column_joins + s = Subscriber.create! do |c| + c.id = "PL" + end + + b = Book.create! do |t| + t.id = "UE" + end + + Subscription.create!(:subscriber_id => "PL", :book_id => "UE") + s.reload + s.books + s.book_ids = s.book_ids + end + def test_eager_load_has_many_through_with_string_keys books = books(:awdr, :rfr) subscriber = Subscriber.find(subscribers(:second).id, :include => :books) |