diff options
author | Robert Evans <robert@codewranglers.org> | 2012-07-06 23:53:02 -0700 |
---|---|---|
committer | Robert Evans <robert@codewranglers.org> | 2012-09-12 09:24:59 -0700 |
commit | 110bfbc5e3d8931daca7f73bb6bb143d77180f36 (patch) | |
tree | b8c7cb118a9856c54778b66e586ff54905c0281c /activerecord/lib/active_record | |
parent | 9f5d2b12025958d024cbe5666dfef80b225dde2c (diff) | |
download | rails-110bfbc5e3d8931daca7f73bb6bb143d77180f36.tar.gz rails-110bfbc5e3d8931daca7f73bb6bb143d77180f36.tar.bz2 rails-110bfbc5e3d8931daca7f73bb6bb143d77180f36.zip |
Added additional comments on how to use the "type" column without
single-table inheritance by overriding it in your ActiveRecord
Model.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/model.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/model.rb b/activerecord/lib/active_record/model.rb index 0015e3a567..b3a840b2f4 100644 --- a/activerecord/lib/active_record/model.rb +++ b/activerecord/lib/active_record/model.rb @@ -103,9 +103,19 @@ module ActiveRecord def abstract_class? false end - + # Defines the name of the table column which will store the class name on single-table # inheritance situations. + # + # The default inheritance column name is +type+, which means it's a + # reserved word inside Active Record. To be able to use single-table + # inheritance with another column name, or to use the column +type+ in + # your own model for something else, you can override this method to + # return a different name: + # + # def self.inheritance_column + # 'zoink' + # end def inheritance_column 'type' end |