aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/belongs_to_associations_test.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-06-23 10:04:17 +0200
committerYves Senn <yves.senn@gmail.com>2015-06-23 10:19:54 +0200
commit5e75f51692cc92ad346fecc4a63fa628c8024149 (patch)
treea481658810f057ea477f8dea7bc64cdcb3934b13 /activerecord/test/cases/associations/belongs_to_associations_test.rb
parent8e27fd95945ac9f81a5ad1b30e5d6c5f32878afa (diff)
parent5a9590c6cbbb4ac26a81ae37088a38778cb12748 (diff)
downloadrails-5e75f51692cc92ad346fecc4a63fa628c8024149.tar.gz
rails-5e75f51692cc92ad346fecc4a63fa628c8024149.tar.bz2
rails-5e75f51692cc92ad346fecc4a63fa628c8024149.zip
Merge pull request #20552 from jamesdabbs/belongs-to-polymorphic-force-reload
Fix `undefined method uncached` for polymorphic belongs_to #20426
Diffstat (limited to 'activerecord/test/cases/associations/belongs_to_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 4a72ec5054..ebe08c618f 100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
@@ -318,9 +318,11 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
def test_polymorphic_association_class
sponsor = Sponsor.new
assert_nil sponsor.association(:sponsorable).send(:klass)
+ assert_nil sponsor.sponsorable(force_reload: true)
sponsor.sponsorable_type = '' # the column doesn't have to be declared NOT NULL
assert_nil sponsor.association(:sponsorable).send(:klass)
+ assert_nil sponsor.sponsorable(force_reload: true)
sponsor.sponsorable = Member.new :name => "Bert"
assert_equal Member, sponsor.association(:sponsorable).send(:klass)