Customizing inspectable attributes in AR Rails 4.

I ran into a case where I wanted to customize the output of the inspect method to include attributes that I’ve defined (which are not associated with database columns) to be displayed in the inspect output. Currently, the attributes for inspection are collected by calling ActiveRecord::ModelSchema::ClassMethods#column_names. It would be nice to instead use a template method that allowed additional, non-database backed attributes to be included without having to rewrite the inspect method.

Pseudo code