From cdfcbc48b25ca76fb0aa821d5ee087768e0d6522 Mon Sep 17 00:00:00 2001 From: kennyj Date: Thu, 8 Mar 2012 00:00:58 +0900 Subject: Don't reset inheritance_column when setting explicitly. --- activerecord/test/cases/base_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activerecord/test/cases/base_test.rb') diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 01f647b261..282cb66f90 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1503,6 +1503,16 @@ class BasicsTest < ActiveRecord::TestCase assert_equal before_seq, after_seq unless before_seq.blank? && after_seq.blank? end + def test_dont_clear_inheritnce_column_when_setting_explicitly + Joke.inheritance_column = "my_type" + before_inherit = Joke.inheritance_column + + Joke.reset_column_information + after_inherit = Joke.inheritance_column + + assert_equal before_inherit, after_inherit unless before_inherit.blank? && after_inherit.blank? + end + def test_set_table_name_symbol_converted_to_string Joke.table_name = :cold_jokes assert_equal 'cold_jokes', Joke.table_name -- cgit v1.2.3 From a8dd21d8b459ce4d57160a359798c577085a95e9 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 2 Mar 2012 00:10:06 -0300 Subject: Remove IdentityMap --- activerecord/test/cases/base_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test/cases/base_test.rb') diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 01f647b261..76b999efac 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1139,7 +1139,7 @@ class BasicsTest < ActiveRecord::TestCase assert g.save # Reload and check that we have all the geometric attributes. - h = ActiveRecord::IdentityMap.without { Geometric.find(g.id) } + h = Geometric.find(g.id) assert_equal '(5,6.1)', h.a_point assert_equal '[(2,3),(5.5,7)]', h.a_line_segment @@ -1168,7 +1168,7 @@ class BasicsTest < ActiveRecord::TestCase assert g.save # Reload and check that we have all the geometric attributes. - h = ActiveRecord::IdentityMap.without { Geometric.find(g.id) } + h = Geometric.find(g.id) assert_equal '(5,6.1)', h.a_point assert_equal '[(2,3),(5.5,7)]', h.a_line_segment -- cgit v1.2.3