Skip to content

Commit

Permalink
Allow global override of default STI inheritance column
Browse files Browse the repository at this point in the history
This change fixes a bug by which 3.2-STABLE users can't globally override the default STI inheritance column with `ActiveRecord::Base.inheritance_column = 'some_column'`. 3.2-STABLE users are forced to use a deprecated method or monkey patch it otherwise.
  • Loading branch information
chapmajs committed May 1, 2013
1 parent 9d7a748 commit 8cfdb72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/model_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def full_table_name_prefix #:nodoc:
# The name of the column containing the object's class when Single Table Inheritance is used
def inheritance_column
if self == Base
'type'
@inheritance_column || 'type'
else
(@inheritance_column ||= nil) || superclass.inheritance_column
end
Expand Down

0 comments on commit 8cfdb72

Please sign in to comment.