Flowdock
method

ensure_proper_type

Importance_1
v3.0.9 - Show latest stable - 0 notes - Class: ActiveRecord::Base
ensure_proper_type() private

Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord::Base descendant. Considering the hierarchy Reply < Message < ActiveRecord::Base, 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.

Show source
Register or log in to add new notes.