diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-03 07:12:18 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-03 07:12:18 -0700 |
commit | 30a8f0d5b675d0eddc0af05103f4eb7f95c7caad (patch) | |
tree | f6a04f5841e1b9f0bff04c698fb7b01355df0cce /activerecord/lib | |
parent | ebc50c505d3c49b0fac7eccf85da6df751d4023c (diff) | |
parent | 20574956d1ca73b5713bb857870fcd57cd09b35e (diff) | |
download | rails-30a8f0d5b675d0eddc0af05103f4eb7f95c7caad.tar.gz rails-30a8f0d5b675d0eddc0af05103f4eb7f95c7caad.tar.bz2 rails-30a8f0d5b675d0eddc0af05103f4eb7f95c7caad.zip |
Merge pull request #7506 from senny/issue_7503
#becomes works with configured inheritance_column
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 ffb8513624..7bd65c180d 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -161,7 +161,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.public_send("#{klass.inheritance_column}=", klass.name) unless self.class.descends_from_active_record? became end |