diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-23 04:19:16 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-23 04:19:16 +0000 |
commit | 06afb8c7465e6b01833edfbae70547cf03c06480 (patch) | |
tree | e6c67cb67b2e84c80864771ba1aa22d546e70a55 /activerecord/lib/active_record/base.rb | |
parent | 7359dc0028b87f948d188f5fa6bb366a49181a81 (diff) | |
download | rails-06afb8c7465e6b01833edfbae70547cf03c06480.tar.gz rails-06afb8c7465e6b01833edfbae70547cf03c06480.tar.bz2 rails-06afb8c7465e6b01833edfbae70547cf03c06480.zip |
Subclasses of an abstract class work with single-table inheritance. References #5704, closes #7284.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6013 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index a783feafed..b8a497ffa3 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -817,8 +817,13 @@ module ActiveRecord #:nodoc: attribute_key_name.humanize end - def descends_from_active_record? # :nodoc: - superclass == Base || !columns_hash.include?(inheritance_column) + # True if this isn't a concrete subclass needing a STI type condition. + def descends_from_active_record? + if superclass.abstract_class? + superclass.descends_from_active_record? + else + superclass == Base || !columns_hash.include?(inheritance_column) + end end |