diff options
author | Fred Wu <ifredwu@gmail.com> | 2013-03-06 10:45:29 +1100 |
---|---|---|
committer | Fred Wu <ifredwu@gmail.com> | 2013-03-27 09:12:31 +1100 |
commit | 55e295470303a6abcf152f24a1a8c7864dab5ef6 (patch) | |
tree | 24915e6019ee5f31dca63d0fb293095be8b8cfe0 /activerecord/test/cases | |
parent | dbd26e92a7b943a57c2826a749ae25e3ce9e143c (diff) | |
download | rails-55e295470303a6abcf152f24a1a8c7864dab5ef6.tar.gz rails-55e295470303a6abcf152f24a1a8c7864dab5ef6.tar.bz2 rails-55e295470303a6abcf152f24a1a8c7864dab5ef6.zip |
Don't reset inheritance_column when setting explicitly.
This is backported from master (cdfcbc4).
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 97d6c0cf88..67b5d174aa 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1540,6 +1540,16 @@ class BasicsTest < ActiveRecord::TestCase end 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 |