def awesome_active_record_instance(object)
      return object.inspect if !defined?(::ActiveSupport::OrderedHash)
      return awesome_object(object) if @options[:raw]

      data = if object.class.column_names != object.attributes.keys
               object.attributes
             else
               object.class.column_names.inject(::ActiveSupport::OrderedHash.new) do |hash, name|
                 if object.has_attribute?(name) || object.new_record?
                   value = object.respond_to?(name) ? object.send(name) : object.read_attribute(name)
                   hash[name.to_sym] = value
                 end
                 hash
               end
             end
      "#{object} " << awesome_hash(data)
    end
def awesome_active_record_instance(object)
      return object.inspect if !defined?(::ActiveSupport::OrderedHash)
      return awesome_object(object) if @options[:raw]

      data = if object.class.column_names != object.attributes.keys
               object.attributes
             else
               object.class.column_names.inject(::ActiveSupport::OrderedHash.new) do |hash, name|
                 if object.has_attribute?(name) || object.new_record?
                   value = object.respond_to?(name) ? object.send(name) : object.read_attribute(name)
                   hash[name.to_sym] = value
                 end
                 hash
               end
             end
      "#{object} " << awesome_hash(data)
    end
Format ActiveRecord instance object.

 NOTE: by default only instance attributes (i.e. columns) are shown. To format
 ActiveRecord instance as regular object showing its instance variables and
 accessors use :raw => true option:

 ap record, :raw => true

------------------------------------------------------------------------------