diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-26 15:22:05 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-26 15:22:05 -0700 |
commit | df37c91745a3fb241fafa23c03387e33eb82c74f (patch) | |
tree | 92b4cb9321a20d1ee03f32c982ac8f332b5469ee /activerecord/lib/active_record/model_schema.rb | |
parent | dbd26e92a7b943a57c2826a749ae25e3ce9e143c (diff) | |
parent | 8bd56f0f7ad2b48a50f12c49d436a469fdbb7135 (diff) | |
download | rails-df37c91745a3fb241fafa23c03387e33eb82c74f.tar.gz rails-df37c91745a3fb241fafa23c03387e33eb82c74f.tar.bz2 rails-df37c91745a3fb241fafa23c03387e33eb82c74f.zip |
Merge pull request #9576 from fredwu/backport_fix_explicitly_inheraitance_column_to_3_2_stable
[Backport to 3-2-stable] Don't reset inheritance_column when setting explicitly.
Diffstat (limited to 'activerecord/lib/active_record/model_schema.rb')
-rw-r--r-- | activerecord/lib/active_record/model_schema.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb index 1517e5ec17..e10e6b4aa8 100644 --- a/activerecord/lib/active_record/model_schema.rb +++ b/activerecord/lib/active_record/model_schema.rb @@ -173,6 +173,7 @@ module ActiveRecord def inheritance_column=(value) @original_inheritance_column = inheritance_column @inheritance_column = value.to_s + @explicit_inheritance_column = true end def set_inheritance_column(value = nil, &block) #:nodoc: @@ -300,7 +301,8 @@ module ActiveRecord connection.schema_cache.clear_table_cache!(table_name) if table_exists? @column_names = @content_columns = @column_defaults = @columns = @columns_hash = nil - @dynamic_methods_hash = @inheritance_column = nil + @dynamic_methods_hash = nil + @inheritance_column = nil unless defined?(@explicit_inheritance_column) && @explicit_inheritance_column @arel_engine = @relation = nil end |