aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-03 07:12:18 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-03 07:12:18 -0700
commit30a8f0d5b675d0eddc0af05103f4eb7f95c7caad (patch)
treef6a04f5841e1b9f0bff04c698fb7b01355df0cce /activerecord/lib
parentebc50c505d3c49b0fac7eccf85da6df751d4023c (diff)
parent20574956d1ca73b5713bb857870fcd57cd09b35e (diff)
downloadrails-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.rb2
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