diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-02 07:04:15 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-04-02 07:04:15 -0700 |
commit | 6fee836866ce70215247b4d1ec48730e0ff8cc7c (patch) | |
tree | 12025828e0e0f4084e387995d2c9445a7fef0e2a /activerecord/lib/active_record/inheritance.rb | |
parent | 299ddbd83cce6b2eaac001a8f1217969161771bf (diff) | |
parent | ab157ac6bef3e1aa9c3a221011c5dd7024f14d7e (diff) | |
download | rails-6fee836866ce70215247b4d1ec48730e0ff8cc7c.tar.gz rails-6fee836866ce70215247b4d1ec48730e0ff8cc7c.tar.bz2 rails-6fee836866ce70215247b4d1ec48730e0ff8cc7c.zip |
Merge pull request #10038 from nateberkopec/sti-new-with-complex-inheritance
Fix regression re: #new with an STI object & complex inheritance
Diffstat (limited to 'activerecord/lib/active_record/inheritance.rb')
-rw-r--r-- | activerecord/lib/active_record/inheritance.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb index f54865c86e..8df76c7f5f 100644 --- a/activerecord/lib/active_record/inheritance.rb +++ b/activerecord/lib/active_record/inheritance.rb @@ -174,7 +174,7 @@ module ActiveRecord if subclass_name.present? && subclass_name != self.name subclass = subclass_name.safe_constantize - unless subclasses.include?(subclass) + unless descendants.include?(subclass) raise ActiveRecord::SubclassNotFound.new("Invalid single-table inheritance type: #{subclass_name} is not a subclass of #{name}") end |