diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-01-24 13:08:32 -0500 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-01-24 13:08:32 -0500 |
commit | 5119171d3927a99b73809aa29e58e8866ad07110 (patch) | |
tree | 148d57924108c741e0a7ff7b5852338b8e6ffcd9 /activerecord/test/cases/reflection_test.rb | |
parent | 6b89c4a24749ed972930ad1e27308bcda48c362b (diff) | |
parent | b334bc93c6c3a37f69de9a130d43b8f1fda67e3c (diff) | |
download | rails-5119171d3927a99b73809aa29e58e8866ad07110.tar.gz rails-5119171d3927a99b73809aa29e58e8866ad07110.tar.bz2 rails-5119171d3927a99b73809aa29e58e8866ad07110.zip |
Merge pull request #23221 from vipulnsward/23209-fix-missin_source_type
Add missing source_type if provided on hmt which belongs to an sti re…
Diffstat (limited to 'activerecord/test/cases/reflection_test.rb')
-rw-r--r-- | activerecord/test/cases/reflection_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/reflection_test.rb b/activerecord/test/cases/reflection_test.rb index 9c04a41e69..a130d9f7ca 100644 --- a/activerecord/test/cases/reflection_test.rb +++ b/activerecord/test/cases/reflection_test.rb @@ -23,6 +23,7 @@ require 'models/chef' require 'models/department' require 'models/cake_designer' require 'models/drink_designer' +require 'models/mocktail_designer' require 'models/recipe' class ReflectionTest < ActiveRecord::TestCase @@ -278,6 +279,14 @@ class ReflectionTest < ActiveRecord::TestCase assert_equal 2, @hotel.chefs.size end + def test_scope_chain_does_not_interfere_with_hmt_with_polymorphic_case_and_sti + @hotel = Hotel.create! + @hotel.mocktail_designers << MocktailDesigner.create! + + assert_equal 1, @hotel.mocktail_designers.size + assert_equal 1, @hotel.chef_lists.size + end + def test_scope_chain_of_polymorphic_association_does_not_leak_into_other_hmt_associations hotel = Hotel.create! department = hotel.departments.create! |