diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-03 07:38:48 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-03 07:38:48 -0700 |
commit | 87ac5b42b1ab05f2e72eb4c702742decdceed7c1 (patch) | |
tree | bee01cb37bfa634b2348d5ede8e8e68d43d6876e /activerecord/lib | |
parent | cabab374bfc6c1bd1d783ecc3c674047f17523c6 (diff) | |
parent | 01d09a6079b0af387c722ba2148cf7af308d3f49 (diff) | |
download | rails-87ac5b42b1ab05f2e72eb4c702742decdceed7c1.tar.gz rails-87ac5b42b1ab05f2e72eb4c702742decdceed7c1.tar.bz2 rails-87ac5b42b1ab05f2e72eb4c702742decdceed7c1.zip |
Merge pull request #7514 from senny/issue_7503_3_2_stable
set the configured #inheritance_column on #become (#7503)
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 038355deaa..8a3c3fed7d 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -162,7 +162,7 @@ module ActiveRecord became.instance_variable_set("@new_record", new_record?) became.instance_variable_set("@destroyed", destroyed?) became.instance_variable_set("@errors", errors) - became.type = klass.name unless self.class.descends_from_active_record? + became.send("#{klass.inheritance_column}=", klass.name) unless self.class.descends_from_active_record? became end |