module ActiveRecord::Inheritance
def ensure_proper_type
do Reply.new without having to set Reply[Reply.inheritance_column] = "Reply" yourself.
Considering the hierarchy Reply < Message < ActiveRecord::Base, this makes it possible to
ActiveRecord::Base descendant.
Sets the attribute used for single table inheritance to this class name if this is not the
def ensure_proper_type klass = self.class if klass.finder_needs_type_condition? _write_attribute(klass.inheritance_column, klass.sti_name) end end
def initialize_dup(other)
def initialize_dup(other) super ensure_proper_type end
def initialize_internals_callback
def initialize_internals_callback super ensure_proper_type end