Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord descendent. Considering the hierarchy Reply < Message < ActiveRecord, this makes it possible to do Reply.new without having to set Reply = "Reply" yourself. No such attribute would be set for objects of the Message class in that example.
# File activerecord/lib/active_record/base.rb, line 1816 def ensure_proper_type unless self.class.descends_from_active_record? write_attribute(self.class.inheritance_column, Inflector.demodulize(self.class.name)) end end